; LLVM IR from kala13x/libxutils :: src/net (mdtp)

; 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.XPacket = type { %struct.XPacketHeader, %struct.XByteBuffer, ptr, ptr, i32, i32, i8, ptr, ptr }
%struct.XPacketHeader = type { i32, i32, i32, i32, i32, i32, i8, [128 x i8], [8 x i8], [64 x i8], [8 x i8] }
%struct.XByteBuffer = type { ptr, i64, i64, i16, i16, i32 }
%struct.xjson_obj_ = type { i32, i8, i8, i8, ptr, ptr, ptr }

@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

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

declare zeroext i8 @xstrused(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @XPacket_UpdateHeader(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %1
  store i32 3, ptr %2, align 4
  br label %248

16:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.XPacket, ptr %17, i32 0, i32 0
  store ptr %18, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.XPacket, ptr %19, i32 0, i32 2
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %33

23:                                               ; preds = %16
  %24 = call ptr @XJSON_NewObject(ptr noundef null, ptr noundef null, i8 noundef zeroext 1)
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.XPacket, ptr %25, i32 0, i32 2
  store ptr %24, ptr %26, align 8, !tbaa !9
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.XPacket, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %247

32:                                               ; preds = %23
  br label %33

33:                                               ; preds = %32, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.XPacket, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  store ptr %36, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.xjson_obj_, ptr %37, i32 0, i32 1
  store i8 1, ptr %38, align 4, !tbaa !16
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.XPacket, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %48

43:                                               ; preds = %33
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.XPacket, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  call void %46(ptr noundef %47, i8 noundef zeroext 1)
  br label %48

48:                                               ; preds = %43, %33
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.XPacketHeader, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 4, !tbaa !19
  %52 = icmp eq i32 %51, 4
  br i1 %52, label %58, label %53

53:                                               ; preds = %48
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.XPacketHeader, ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !19
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %59

58:                                               ; preds = %53, %48
  store i32 4, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %246

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.XPacketHeader, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !19
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  br label %70

65:                                               ; preds = %59
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.XPacketHeader, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 4, !tbaa !19
  %69 = call ptr @XPacket_GetTypeStr(i32 noundef %68)
  br label %70

70:                                               ; preds = %65, %64
  %71 = phi ptr [ null, %64 ], [ %69, %65 ]
  store ptr %71, ptr %7, align 8, !tbaa !5
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.XPacketHeader, ptr %72, i32 0, i32 8
  %74 = getelementptr inbounds [8 x i8], ptr %73, i64 0, i64 0
  %75 = call zeroext i8 @xstrused(ptr noundef %74)
  %76 = zext i8 %75 to i32
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %85

78:                                               ; preds = %70
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.XPacketHeader, ptr %80, i32 0, i32 8
  %82 = getelementptr inbounds [8 x i8], ptr %81, i64 0, i64 0
  %83 = call i32 @XJSON_AddString(ptr noundef %79, ptr noundef @.str.20, ptr noundef %82)
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %131, label %85

85:                                               ; preds = %78, %70
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = call zeroext i8 @xstrused(ptr noundef %86)
  %88 = zext i8 %87 to i32
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %95

90:                                               ; preds = %85
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = call i32 @XJSON_AddString(ptr noundef %91, ptr noundef @.str.21, ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %131, label %95

95:                                               ; preds = %90, %85
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.XPacketHeader, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !20
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %107

100:                                              ; preds = %95
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.XPacketHeader, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !20
  %105 = call i32 @XJSON_AddU32(ptr noundef %101, ptr noundef @.str.23, i32 noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %131, label %107

107:                                              ; preds = %100, %95
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.XPacketHeader, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 4, !tbaa !21
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %119

112:                                              ; preds = %107
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.XPacketHeader, ptr %114, i32 0, i32 3
  %116 = load i32, ptr %115, align 4, !tbaa !21
  %117 = call i32 @XJSON_AddU32(ptr noundef %113, ptr noundef @.str.22, i32 noundef %116)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %131, label %119

119:                                              ; preds = %112, %107
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.XPacketHeader, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !22
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %134

124:                                              ; preds = %119
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.XPacketHeader, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !22
  %129 = call i32 @XJSON_AddU32(ptr noundef %125, ptr noundef @.str.24, i32 noundef %128)
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %124, %112, %100, %90, %78
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.XPacketHeader, ptr %132, i32 0, i32 0
  store i32 4, ptr %133, align 4, !tbaa !19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %245

134:                                              ; preds = %124, %119
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.XPacketHeader, ptr %135, i32 0, i32 7
  %137 = getelementptr inbounds [128 x i8], ptr %136, i64 0, i64 0
  %138 = call zeroext i8 @xstrused(ptr noundef %137)
  store i8 %138, ptr %8, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.XPacketHeader, ptr %139, i32 0, i32 9
  %141 = getelementptr inbounds [64 x i8], ptr %140, i64 0, i64 0
  %142 = call zeroext i8 @xstrused(ptr noundef %141)
  store i8 %142, ptr %9, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.XPacketHeader, ptr %143, i32 0, i32 10
  %145 = getelementptr inbounds [8 x i8], ptr %144, i64 0, i64 0
  %146 = call zeroext i8 @xstrused(ptr noundef %145)
  store i8 %146, ptr %10, align 1, !tbaa !23
  %147 = load i8, ptr %9, align 1, !tbaa !23
  %148 = zext i8 %147 to i32
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %154, label %150

150:                                              ; preds = %134
  %151 = load i8, ptr %10, align 1, !tbaa !23
  %152 = zext i8 %151 to i32
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %191

154:                                              ; preds = %150, %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call ptr @XJSON_GetOrCreateObject(ptr noundef %155, ptr noundef @.str.30, i8 noundef zeroext 1)
  store ptr %156, ptr %11, align 8, !tbaa !5
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %159, label %162

159:                                              ; preds = %154
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.XPacketHeader, ptr %160, i32 0, i32 0
  store i32 4, ptr %161, align 4, !tbaa !19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %188

162:                                              ; preds = %154
  %163 = load i8, ptr %9, align 1, !tbaa !23
  %164 = zext i8 %163 to i32
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %173

166:                                              ; preds = %162
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.XPacketHeader, ptr %168, i32 0, i32 9
  %170 = getelementptr inbounds [64 x i8], ptr %169, i64 0, i64 0
  %171 = call i32 @XJSON_AddString(ptr noundef %167, ptr noundef @.str.31, ptr noundef %170)
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %184, label %173

173:                                              ; preds = %166, %162
  %174 = load i8, ptr %10, align 1, !tbaa !23
  %175 = zext i8 %174 to i32
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %187

177:                                              ; preds = %173
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.XPacketHeader, ptr %179, i32 0, i32 10
  %181 = getelementptr inbounds [8 x i8], ptr %180, i64 0, i64 0
  %182 = call i32 @XJSON_AddString(ptr noundef %178, ptr noundef @.str.32, ptr noundef %181)
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %187

184:                                              ; preds = %177, %166
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.XPacketHeader, ptr %185, i32 0, i32 0
  store i32 4, ptr %186, align 4, !tbaa !19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %188

187:                                              ; preds = %177, %173
  store i32 0, ptr %5, align 4
  br label %188

188:                                              ; preds = %187, %184, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %189 = load i32, ptr %5, align 4
  switch i32 %189, label %244 [
    i32 0, label %190
  ]

190:                                              ; preds = %188
  br label %191

191:                                              ; preds = %190, %150
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.XPacketHeader, ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 4, !tbaa !24
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %243

196:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = call ptr @XJSON_GetOrCreateObject(ptr noundef %197, ptr noundef @.str.25, i8 noundef zeroext 1)
  store ptr %198, ptr %12, align 8, !tbaa !5
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = icmp eq ptr %199, null
  br i1 %200, label %201, label %204

201:                                              ; preds = %196
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.XPacketHeader, ptr %202, i32 0, i32 0
  store i32 4, ptr %203, align 4, !tbaa !19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %240

204:                                              ; preds = %196
  %205 = load i8, ptr %8, align 1, !tbaa !23
  %206 = zext i8 %205 to i32
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %208, label %215

208:                                              ; preds = %204
  %209 = load ptr, ptr %12, align 8, !tbaa !5
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.XPacketHeader, ptr %210, i32 0, i32 7
  %212 = getelementptr inbounds [128 x i8], ptr %211, i64 0, i64 0
  %213 = call i32 @XJSON_AddString(ptr noundef %209, ptr noundef @.str.26, ptr noundef %212)
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %236, label %215

215:                                              ; preds = %208, %204
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.XPacketHeader, ptr %216, i32 0, i32 6
  %218 = load i8, ptr %217, align 4, !tbaa !25
  %219 = zext i8 %218 to i32
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %229

221:                                              ; preds = %215
  %222 = load ptr, ptr %12, align 8, !tbaa !5
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.XPacketHeader, ptr %223, i32 0, i32 6
  %225 = load i8, ptr %224, align 4, !tbaa !25
  %226 = zext i8 %225 to i32
  %227 = call i32 @XJSON_AddBool(ptr noundef %222, ptr noundef @.str.28, i32 noundef %226)
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %236, label %229

229:                                              ; preds = %221, %215
  %230 = load ptr, ptr %12, align 8, !tbaa !5
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.XPacketHeader, ptr %231, i32 0, i32 4
  %233 = load i32, ptr %232, align 4, !tbaa !24
  %234 = call i32 @XJSON_AddU32(ptr noundef %230, ptr noundef @.str.27, i32 noundef %233)
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %239

236:                                              ; preds = %229, %221, %208
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.XPacketHeader, ptr %237, i32 0, i32 0
  store i32 4, ptr %238, align 4, !tbaa !19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %240

239:                                              ; preds = %229
  store i32 0, ptr %5, align 4
  br label %240

240:                                              ; preds = %239, %236, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %241 = load i32, ptr %5, align 4
  switch i32 %241, label %244 [
    i32 0, label %242
  ]

242:                                              ; preds = %240
  br label %243

243:                                              ; preds = %242, %191
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %244

244:                                              ; preds = %243, %240, %188
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  br label %245

245:                                              ; preds = %244, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %246

246:                                              ; preds = %245, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %247

247:                                              ; preds = %246, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %248

248:                                              ; preds = %247, %15
  %249 = load i32, ptr %2, align 4
  ret i32 %249
}

declare ptr @XJSON_NewObject(ptr noundef, ptr noundef, i8 noundef zeroext) #2

declare i32 @XJSON_AddString(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @XJSON_AddU32(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @XJSON_GetOrCreateObject(ptr noundef, ptr noundef, i8 noundef zeroext) #2

declare i32 @XJSON_AddBool(ptr noundef, ptr noundef, i32 noundef) #2

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

!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, !6, i64 272}
!10 = !{!"XPacket", !11, i64 0, !13, i64 240, !6, i64 272, !6, i64 280, !12, i64 288, !12, i64 292, !7, i64 296, !6, i64 304, !6, i64 312}
!11 = !{!"XPacketHeader", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !7, i64 24, !7, i64 25, !7, i64 153, !7, i64 161, !7, i64 225}
!12 = !{!"int", !7, i64 0}
!13 = !{!"XByteBuffer", !6, i64 0, !14, i64 8, !14, i64 16, !15, i64 24, !15, i64 26, !12, i64 28}
!14 = !{!"long", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !7, i64 4}
!17 = !{!"xjson_obj_", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!10, !6, i64 280}
!19 = !{!11, !12, i64 0}
!20 = !{!11, !12, i64 8}
!21 = !{!11, !12, i64 12}
!22 = !{!11, !12, i64 4}
!23 = !{!7, !7, i64 0}
!24 = !{!11, !12, i64 16}
!25 = !{!11, !7, i64 24}


; 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"

@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @XPacket_GetTypeStr(i32 noundef) local_unnamed_addr #0

declare zeroext i8 @xstrused(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 5) i32 @XPacket_UpdateHeader(ptr noundef %0) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.critedge, label %2

2:                                                ; preds = %1
  %3 = getelementptr inbounds i8, ptr %0, i64 272
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %9

6:                                                ; preds = %2
  %7 = tail call ptr @XJSON_NewObject(ptr noundef null, ptr noundef null, i8 noundef zeroext 1) #2
  store ptr %7, ptr %3, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %.critedge, label %9

9:                                                ; preds = %6, %2
  %10 = phi ptr [ %7, %6 ], [ %4, %2 ]
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  store i8 1, ptr %11, align 4, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 280
  %13 = load ptr, ptr %12, align 8, !tbaa !17
  %.not73 = icmp eq ptr %13, null
  br i1 %.not73, label %15, label %14

14:                                               ; preds = %9
  tail call void %13(ptr noundef nonnull %0, i8 noundef zeroext 1) #2
  br label %15

15:                                               ; preds = %14, %9
  %16 = load i32, ptr %0, align 4, !tbaa !18
  switch i32 %16, label %17 [
    i32 4, label %.critedge
    i32 1, label %.critedge
    i32 0, label %19
  ]

17:                                               ; preds = %15
  %18 = tail call ptr @XPacket_GetTypeStr(i32 noundef %16)
  br label %19

19:                                               ; preds = %15, %17
  %20 = phi ptr [ %18, %17 ], [ null, %15 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 153
  %22 = tail call zeroext i8 @xstrused(ptr noundef nonnull %21) #2
  %.not74 = icmp eq i8 %22, 0
  br i1 %.not74, label %25, label %23

23:                                               ; preds = %19
  %24 = tail call i32 @XJSON_AddString(ptr noundef nonnull %10, ptr noundef nonnull @.str.20, ptr noundef nonnull %21) #2
  %.not75 = icmp eq i32 %24, 0
  br i1 %.not75, label %25, label %.critedge.sink.split

25:                                               ; preds = %23, %19
  %26 = tail call zeroext i8 @xstrused(ptr noundef %20) #2
  %.not76 = icmp eq i8 %26, 0
  br i1 %.not76, label %29, label %27

27:                                               ; preds = %25
  %28 = tail call i32 @XJSON_AddString(ptr noundef nonnull %10, ptr noundef nonnull @.str.21, ptr noundef %20) #2
  %.not77 = icmp eq i32 %28, 0
  br i1 %.not77, label %29, label %.critedge.sink.split

29:                                               ; preds = %27, %25
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load i32, ptr %30, align 4, !tbaa !19
  %.not78 = icmp eq i32 %31, 0
  br i1 %.not78, label %34, label %32

32:                                               ; preds = %29
  %33 = tail call i32 @XJSON_AddU32(ptr noundef nonnull %10, ptr noundef nonnull @.str.23, i32 noundef %31) #2
  %.not79 = icmp eq i32 %33, 0
  br i1 %.not79, label %34, label %.critedge.sink.split

34:                                               ; preds = %32, %29
  %35 = getelementptr inbounds i8, ptr %0, i64 12
  %36 = load i32, ptr %35, align 4, !tbaa !20
  %.not80 = icmp eq i32 %36, 0
  br i1 %.not80, label %39, label %37

37:                                               ; preds = %34
  %38 = tail call i32 @XJSON_AddU32(ptr noundef nonnull %10, ptr noundef nonnull @.str.22, i32 noundef %36) #2
  %.not81 = icmp eq i32 %38, 0
  br i1 %.not81, label %39, label %.critedge.sink.split

39:                                               ; preds = %37, %34
  %40 = getelementptr inbounds i8, ptr %0, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %.not82 = icmp eq i32 %41, 0
  br i1 %.not82, label %44, label %42

42:                                               ; preds = %39
  %43 = tail call i32 @XJSON_AddU32(ptr noundef nonnull %10, ptr noundef nonnull @.str.24, i32 noundef %41) #2
  %.not83 = icmp eq i32 %43, 0
  br i1 %.not83, label %44, label %.critedge.sink.split

44:                                               ; preds = %42, %39
  %45 = getelementptr inbounds i8, ptr %0, i64 25
  %46 = tail call zeroext i8 @xstrused(ptr noundef nonnull %45) #2
  %47 = getelementptr inbounds i8, ptr %0, i64 161
  %48 = tail call zeroext i8 @xstrused(ptr noundef nonnull %47) #2
  %49 = getelementptr inbounds i8, ptr %0, i64 225
  %50 = tail call zeroext i8 @xstrused(ptr noundef nonnull %49) #2
  %51 = icmp ne i8 %48, 0
  %52 = icmp ne i8 %50, 0
  %or.cond = select i1 %51, i1 true, i1 %52
  br i1 %or.cond, label %53, label %62

53:                                               ; preds = %44
  %54 = tail call ptr @XJSON_GetOrCreateObject(ptr noundef nonnull %10, ptr noundef nonnull @.str.30, i8 noundef zeroext 1) #2
  %55 = icmp eq ptr %54, null
  br i1 %55, label %.critedge.sink.split, label %56

56:                                               ; preds = %53
  br i1 %51, label %57, label %59

57:                                               ; preds = %56
  %58 = tail call i32 @XJSON_AddString(ptr noundef nonnull %54, ptr noundef nonnull @.str.31, ptr noundef nonnull %47) #2
  %.not84 = icmp eq i32 %58, 0
  br i1 %.not84, label %59, label %.critedge.sink.split

59:                                               ; preds = %57, %56
  br i1 %52, label %60, label %62

60:                                               ; preds = %59
  %61 = tail call i32 @XJSON_AddString(ptr noundef nonnull %54, ptr noundef nonnull @.str.32, ptr noundef nonnull %49) #2
  %.not85 = icmp eq i32 %61, 0
  br i1 %.not85, label %62, label %.critedge.sink.split

62:                                               ; preds = %60, %59, %44
  %63 = getelementptr inbounds i8, ptr %0, i64 16
  %64 = load i32, ptr %63, align 4, !tbaa !22
  %.not86 = icmp eq i32 %64, 0
  br i1 %.not86, label %.critedge, label %65

65:                                               ; preds = %62
  %66 = tail call ptr @XJSON_GetOrCreateObject(ptr noundef nonnull %10, ptr noundef nonnull @.str.25, i8 noundef zeroext 1) #2
  %67 = icmp eq ptr %66, null
  br i1 %67, label %.critedge.sink.split, label %68

68:                                               ; preds = %65
  %.not87 = icmp eq i8 %46, 0
  br i1 %.not87, label %71, label %69

69:                                               ; preds = %68
  %70 = tail call i32 @XJSON_AddString(ptr noundef nonnull %66, ptr noundef nonnull @.str.26, ptr noundef nonnull %45) #2
  %.not88 = icmp eq i32 %70, 0
  br i1 %.not88, label %71, label %.critedge.sink.split

71:                                               ; preds = %69, %68
  %72 = getelementptr inbounds i8, ptr %0, i64 24
  %73 = load i8, ptr %72, align 4, !tbaa !23
  %.not89 = icmp eq i8 %73, 0
  br i1 %.not89, label %77, label %74

74:                                               ; preds = %71
  %75 = zext i8 %73 to i32
  %76 = tail call i32 @XJSON_AddBool(ptr noundef nonnull %66, ptr noundef nonnull @.str.28, i32 noundef %75) #2
  %.not90 = icmp eq i32 %76, 0
  br i1 %.not90, label %77, label %.critedge.sink.split

77:                                               ; preds = %74, %71
  %78 = load i32, ptr %63, align 4, !tbaa !22
  %79 = tail call i32 @XJSON_AddU32(ptr noundef nonnull %66, ptr noundef nonnull @.str.27, i32 noundef %78) #2
  %.not91 = icmp eq i32 %79, 0
  br i1 %.not91, label %.critedge, label %.critedge.sink.split

.critedge.sink.split:                             ; preds = %69, %74, %77, %65, %57, %60, %53, %23, %27, %32, %37, %42
  store i32 4, ptr %0, align 4, !tbaa !18
  br label %.critedge

.critedge:                                        ; preds = %.critedge.sink.split, %6, %62, %77, %15, %15, %1
  %.7 = phi i32 [ 3, %1 ], [ 1, %6 ], [ 4, %15 ], [ 4, %15 ], [ 0, %77 ], [ 0, %62 ], [ 1, %.critedge.sink.split ]
  ret i32 %.7
}

declare ptr @XJSON_NewObject(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

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

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

declare ptr @XJSON_GetOrCreateObject(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

declare i32 @XJSON_AddBool(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #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 = { 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, !12, i64 272}
!6 = !{!"XPacket", !7, i64 0, !11, i64 240, !12, i64 272, !12, i64 280, !8, i64 288, !8, i64 292, !9, i64 296, !12, i64 304, !12, i64 312}
!7 = !{!"XPacketHeader", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !9, i64 24, !9, i64 25, !9, i64 153, !9, i64 161, !9, i64 225}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"XByteBuffer", !12, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !14, i64 26, !8, i64 28}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!"short", !9, i64 0}
!15 = !{!16, !9, i64 4}
!16 = !{!"xjson_obj_", !8, i64 0, !9, i64 4, !9, i64 5, !9, i64 6, !12, i64 8, !12, i64 16, !12, i64 24}
!17 = !{!6, !12, i64 280}
!18 = !{!7, !8, i64 0}
!19 = !{!7, !8, i64 8}
!20 = !{!7, !8, i64 12}
!21 = !{!7, !8, i64 4}
!22 = !{!7, !8, i64 16}
!23 = !{!7, !9, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass