; LLVM IR from kala13x/libxutils :: examples (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.XLogConfig = type { i32, i32, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i16, [256 x i8], [2048 x i8], [256 x i8] }
%struct.XPool = type { ptr, ptr, i64, i64, i8 }
%struct.xjson_writer_ = type { %struct.xjson_format_, i8, i64, i64, i64, i64, i64, ptr, ptr, i8 }
%struct.xjson_format_ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.xjson_ = type { %struct.xjson_token_, i32, ptr, ptr, ptr, i64, i64 }
%struct.xjson_token_ = type { i32, ptr, i64 }
%struct.xjson_obj_ = type { i32, i8, i8, i8, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.XLogConfig, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.XPool, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.xjson_writer_, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %struct.xjson_, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca [4098 x i8], align 16
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i64, align 8
  %41 = alloca i64, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca ptr, align 8
  %45 = alloca %struct.xjson_writer_, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @XLog_Init(ptr noundef null, i16 noundef zeroext 203, i8 noundef zeroext 0)
  call void @llvm.lifetime.start.p0(i64 2600, ptr %6) #5
  call void @XLog_ConfigGet(ptr noundef %6)
  %46 = getelementptr inbounds %struct.XLogConfig, ptr %6, i32 0, i32 7
  store i8 1, ptr %46, align 1, !tbaa !11
  %47 = getelementptr inbounds %struct.XLogConfig, ptr %6, i32 0, i32 11
  store i8 1, ptr %47, align 1, !tbaa !14
  call void @XLog_ConfigSet(ptr noundef %6)
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 2
  br i1 %49, label %50, label %51

50:                                               ; preds = %2
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %456

51:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #5
  %52 = call i32 @XPool_Init(ptr noundef %8, i64 noundef 65536)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr %8, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %53 = load ptr, ptr %9, align 8, !tbaa !9
  %54 = call ptr @XJSON_NewArray(ptr noundef %53, ptr noundef null, i8 noundef zeroext 0)
  store ptr %54, ptr %10, align 8, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %260

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = call ptr @XJSON_NewObject(ptr noundef %58, ptr noundef null, i8 noundef zeroext 0)
  store ptr %59, ptr %11, align 8, !tbaa !9
  %60 = load ptr, ptr %11, align 8, !tbaa !9
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %236

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %63 = load ptr, ptr %9, align 8, !tbaa !9
  %64 = call ptr @XJSON_NewObject(ptr noundef %63, ptr noundef @.str.1, i8 noundef zeroext 0)
  store ptr %64, ptr %12, align 8, !tbaa !9
  %65 = load ptr, ptr %12, align 8, !tbaa !9
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %232

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %68 = load ptr, ptr %9, align 8, !tbaa !9
  %69 = call ptr @XJSON_NewObject(ptr noundef %68, ptr noundef @.str.2, i8 noundef zeroext 0)
  store ptr %69, ptr %13, align 8, !tbaa !9
  %70 = load ptr, ptr %13, align 8, !tbaa !9
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %105

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %73 = load ptr, ptr %9, align 8, !tbaa !9
  %74 = call ptr @XJSON_NewObject(ptr noundef %73, ptr noundef @.str.3, i8 noundef zeroext 0)
  store ptr %74, ptr %14, align 8, !tbaa !9
  %75 = load ptr, ptr %14, align 8, !tbaa !9
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %93

77:                                               ; preds = %72
  %78 = load ptr, ptr %14, align 8, !tbaa !9
  %79 = load ptr, ptr %9, align 8, !tbaa !9
  %80 = call ptr @XJSON_NewBool(ptr noundef %79, ptr noundef @.str.4, i32 noundef 1)
  %81 = call i32 @XJSON_AddObject(ptr noundef %78, ptr noundef %80)
  %82 = load ptr, ptr %14, align 8, !tbaa !9
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = call ptr @XJSON_NewString(ptr noundef %83, ptr noundef @.str.5, ptr noundef @.str.6)
  %85 = call i32 @XJSON_AddObject(ptr noundef %82, ptr noundef %84)
  %86 = load ptr, ptr %14, align 8, !tbaa !9
  %87 = load ptr, ptr %9, align 8, !tbaa !9
  %88 = call ptr @XJSON_NewString(ptr noundef %87, ptr noundef @.str.7, ptr noundef @.str.8)
  %89 = call i32 @XJSON_AddObject(ptr noundef %86, ptr noundef %88)
  %90 = load ptr, ptr %13, align 8, !tbaa !9
  %91 = load ptr, ptr %14, align 8, !tbaa !9
  %92 = call i32 @XJSON_AddObject(ptr noundef %90, ptr noundef %91)
  br label %93

93:                                               ; preds = %77, %72
  %94 = load ptr, ptr %13, align 8, !tbaa !9
  %95 = load ptr, ptr %9, align 8, !tbaa !9
  %96 = call ptr @XJSON_NewFloat(ptr noundef %95, ptr noundef @.str.9, double noundef 0x404E733343FA2AD4)
  %97 = call i32 @XJSON_AddObject(ptr noundef %94, ptr noundef %96)
  %98 = load ptr, ptr %13, align 8, !tbaa !9
  %99 = load ptr, ptr %9, align 8, !tbaa !9
  %100 = call ptr @XJSON_NewInt(ptr noundef %99, ptr noundef @.str.10, i32 noundef 66)
  %101 = call i32 @XJSON_AddObject(ptr noundef %98, ptr noundef %100)
  %102 = load ptr, ptr %12, align 8, !tbaa !9
  %103 = load ptr, ptr %13, align 8, !tbaa !9
  %104 = call i32 @XJSON_AddObject(ptr noundef %102, ptr noundef %103)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %105

105:                                              ; preds = %93, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  %107 = call ptr @XJSON_NewObject(ptr noundef %106, ptr noundef @.str.11, i8 noundef zeroext 0)
  store ptr %107, ptr %15, align 8, !tbaa !9
  %108 = load ptr, ptr %15, align 8, !tbaa !9
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %143

110:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %111 = load ptr, ptr %9, align 8, !tbaa !9
  %112 = call ptr @XJSON_NewArray(ptr noundef %111, ptr noundef @.str.12, i8 noundef zeroext 0)
  store ptr %112, ptr %16, align 8, !tbaa !9
  %113 = load ptr, ptr %16, align 8, !tbaa !9
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %131

115:                                              ; preds = %110
  %116 = load ptr, ptr %16, align 8, !tbaa !9
  %117 = load ptr, ptr %9, align 8, !tbaa !9
  %118 = call ptr @XJSON_NewBool(ptr noundef %117, ptr noundef null, i32 noundef 1)
  %119 = call i32 @XJSON_AddObject(ptr noundef %116, ptr noundef %118)
  %120 = load ptr, ptr %16, align 8, !tbaa !9
  %121 = load ptr, ptr %9, align 8, !tbaa !9
  %122 = call ptr @XJSON_NewInt(ptr noundef %121, ptr noundef null, i32 noundef 69)
  %123 = call i32 @XJSON_AddObject(ptr noundef %120, ptr noundef %122)
  %124 = load ptr, ptr %16, align 8, !tbaa !9
  %125 = load ptr, ptr %9, align 8, !tbaa !9
  %126 = call ptr @XJSON_NewFloat(ptr noundef %125, ptr noundef null, double noundef 0x40517999A1FD156A)
  %127 = call i32 @XJSON_AddObject(ptr noundef %124, ptr noundef %126)
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  %129 = load ptr, ptr %16, align 8, !tbaa !9
  %130 = call i32 @XJSON_AddObject(ptr noundef %128, ptr noundef %129)
  br label %131

131:                                              ; preds = %115, %110
  %132 = load ptr, ptr %15, align 8, !tbaa !9
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = call ptr @XJSON_NewString(ptr noundef %133, ptr noundef @.str.13, ptr noundef @.str.14)
  %135 = call i32 @XJSON_AddObject(ptr noundef %132, ptr noundef %134)
  %136 = load ptr, ptr %15, align 8, !tbaa !9
  %137 = load ptr, ptr %9, align 8, !tbaa !9
  %138 = call ptr @XJSON_NewBool(ptr noundef %137, ptr noundef @.str.15, i32 noundef 1)
  %139 = call i32 @XJSON_AddObject(ptr noundef %136, ptr noundef %138)
  %140 = load ptr, ptr %12, align 8, !tbaa !9
  %141 = load ptr, ptr %15, align 8, !tbaa !9
  %142 = call i32 @XJSON_AddObject(ptr noundef %140, ptr noundef %141)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %143

143:                                              ; preds = %131, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %144 = load ptr, ptr %9, align 8, !tbaa !9
  %145 = call ptr @XJSON_NewArray(ptr noundef %144, ptr noundef @.str.16, i8 noundef zeroext 0)
  store ptr %145, ptr %17, align 8, !tbaa !9
  %146 = load ptr, ptr %17, align 8, !tbaa !9
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %203

148:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %149 = load ptr, ptr %9, align 8, !tbaa !9
  %150 = call ptr @XJSON_NewObject(ptr noundef %149, ptr noundef null, i8 noundef zeroext 0)
  store ptr %150, ptr %18, align 8, !tbaa !9
  %151 = load ptr, ptr %18, align 8, !tbaa !9
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %165

153:                                              ; preds = %148
  %154 = load ptr, ptr %18, align 8, !tbaa !9
  %155 = load ptr, ptr %9, align 8, !tbaa !9
  %156 = call ptr @XJSON_NewFloat(ptr noundef %155, ptr noundef @.str.17, double noundef 0x404EF33343FA2AD4)
  %157 = call i32 @XJSON_AddObject(ptr noundef %154, ptr noundef %156)
  %158 = load ptr, ptr %18, align 8, !tbaa !9
  %159 = load ptr, ptr %9, align 8, !tbaa !9
  %160 = call ptr @XJSON_NewInt(ptr noundef %159, ptr noundef @.str.18, i32 noundef -67)
  %161 = call i32 @XJSON_AddObject(ptr noundef %158, ptr noundef %160)
  %162 = load ptr, ptr %17, align 8, !tbaa !9
  %163 = load ptr, ptr %18, align 8, !tbaa !9
  %164 = call i32 @XJSON_AddObject(ptr noundef %162, ptr noundef %163)
  br label %165

165:                                              ; preds = %153, %148
  %166 = load ptr, ptr %9, align 8, !tbaa !9
  %167 = call ptr @XJSON_NewObject(ptr noundef %166, ptr noundef null, i8 noundef zeroext 0)
  store ptr %167, ptr %18, align 8, !tbaa !9
  %168 = load ptr, ptr %18, align 8, !tbaa !9
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %182

170:                                              ; preds = %165
  %171 = load ptr, ptr %18, align 8, !tbaa !9
  %172 = load ptr, ptr %9, align 8, !tbaa !9
  %173 = call ptr @XJSON_NewFloat(ptr noundef %172, ptr noundef @.str.17, double noundef 0x404F733343FA2AD4)
  %174 = call i32 @XJSON_AddObject(ptr noundef %171, ptr noundef %173)
  %175 = load ptr, ptr %18, align 8, !tbaa !9
  %176 = load ptr, ptr %9, align 8, !tbaa !9
  %177 = call ptr @XJSON_NewInt(ptr noundef %176, ptr noundef @.str.18, i32 noundef 68)
  %178 = call i32 @XJSON_AddObject(ptr noundef %175, ptr noundef %177)
  %179 = load ptr, ptr %17, align 8, !tbaa !9
  %180 = load ptr, ptr %18, align 8, !tbaa !9
  %181 = call i32 @XJSON_AddObject(ptr noundef %179, ptr noundef %180)
  br label %182

182:                                              ; preds = %170, %165
  %183 = load ptr, ptr %9, align 8, !tbaa !9
  %184 = call ptr @XJSON_NewObject(ptr noundef %183, ptr noundef null, i8 noundef zeroext 0)
  store ptr %184, ptr %18, align 8, !tbaa !9
  %185 = load ptr, ptr %18, align 8, !tbaa !9
  %186 = icmp ne ptr %185, null
  br i1 %186, label %187, label %199

187:                                              ; preds = %182
  %188 = load ptr, ptr %18, align 8, !tbaa !9
  %189 = load ptr, ptr %9, align 8, !tbaa !9
  %190 = call ptr @XJSON_NewFloat(ptr noundef %189, ptr noundef @.str.17, double noundef 0x404FFC1ECD75942C)
  %191 = call i32 @XJSON_AddObject(ptr noundef %188, ptr noundef %190)
  %192 = load ptr, ptr %18, align 8, !tbaa !9
  %193 = load ptr, ptr %9, align 8, !tbaa !9
  %194 = call ptr @XJSON_NewInt(ptr noundef %193, ptr noundef @.str.18, i32 noundef -69)
  %195 = call i32 @XJSON_AddObject(ptr noundef %192, ptr noundef %194)
  %196 = load ptr, ptr %17, align 8, !tbaa !9
  %197 = load ptr, ptr %18, align 8, !tbaa !9
  %198 = call i32 @XJSON_AddObject(ptr noundef %196, ptr noundef %197)
  br label %199

199:                                              ; preds = %187, %182
  %200 = load ptr, ptr %12, align 8, !tbaa !9
  %201 = load ptr, ptr %17, align 8, !tbaa !9
  %202 = call i32 @XJSON_AddObject(ptr noundef %200, ptr noundef %201)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %203

203:                                              ; preds = %199, %143
  %204 = load ptr, ptr %12, align 8, !tbaa !9
  %205 = load ptr, ptr %9, align 8, !tbaa !9
  %206 = call ptr @XJSON_NewObject(ptr noundef %205, ptr noundef @.str.19, i8 noundef zeroext 0)
  %207 = call i32 @XJSON_AddObject(ptr noundef %204, ptr noundef %206)
  %208 = load ptr, ptr %12, align 8, !tbaa !9
  %209 = load ptr, ptr %9, align 8, !tbaa !9
  %210 = call ptr @XJSON_NewArray(ptr noundef %209, ptr noundef @.str.20, i8 noundef zeroext 0)
  %211 = call i32 @XJSON_AddObject(ptr noundef %208, ptr noundef %210)
  %212 = load ptr, ptr %12, align 8, !tbaa !9
  %213 = load ptr, ptr %9, align 8, !tbaa !9
  %214 = call ptr @XJSON_NewNull(ptr noundef %213, ptr noundef @.str.21)
  %215 = call i32 @XJSON_AddObject(ptr noundef %212, ptr noundef %214)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %216 = load ptr, ptr %9, align 8, !tbaa !9
  %217 = call ptr @XJSON_NewArray(ptr noundef %216, ptr noundef @.str.22, i8 noundef zeroext 0)
  store ptr %217, ptr %19, align 8, !tbaa !9
  %218 = load ptr, ptr %19, align 8, !tbaa !9
  %219 = icmp ne ptr %218, null
  br i1 %219, label %220, label %228

220:                                              ; preds = %203
  %221 = load ptr, ptr %19, align 8, !tbaa !9
  %222 = load ptr, ptr %9, align 8, !tbaa !9
  %223 = call ptr @XJSON_NewObject(ptr noundef %222, ptr noundef null, i8 noundef zeroext 0)
  %224 = call i32 @XJSON_AddObject(ptr noundef %221, ptr noundef %223)
  %225 = load ptr, ptr %12, align 8, !tbaa !9
  %226 = load ptr, ptr %19, align 8, !tbaa !9
  %227 = call i32 @XJSON_AddObject(ptr noundef %225, ptr noundef %226)
  br label %228

228:                                              ; preds = %220, %203
  %229 = load ptr, ptr %11, align 8, !tbaa !9
  %230 = load ptr, ptr %12, align 8, !tbaa !9
  %231 = call i32 @XJSON_AddObject(ptr noundef %229, ptr noundef %230)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %232

232:                                              ; preds = %228, %62
  %233 = load ptr, ptr %10, align 8, !tbaa !9
  %234 = load ptr, ptr %11, align 8, !tbaa !9
  %235 = call i32 @XJSON_AddObject(ptr noundef %233, ptr noundef %234)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %236

236:                                              ; preds = %232, %57
  call void @llvm.lifetime.start.p0(i64 168, ptr %20) #5
  %237 = load ptr, ptr %9, align 8, !tbaa !9
  %238 = call i32 @XJSON_InitWriter(ptr noundef %20, ptr noundef %237, ptr noundef null, i64 noundef 1)
  %239 = getelementptr inbounds %struct.xjson_writer_, ptr %20, i32 0, i32 2
  store i64 4, ptr %239, align 8, !tbaa !15
  %240 = load ptr, ptr %10, align 8, !tbaa !9
  %241 = call i32 @XJSON_WriteObject(ptr noundef %240, ptr noundef %20)
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %258

243:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %244 = load ptr, ptr %5, align 8, !tbaa !9
  %245 = getelementptr inbounds ptr, ptr %244, i64 1
  %246 = load ptr, ptr %245, align 8, !tbaa !9
  %247 = call ptr @XFile_Alloc(ptr noundef %246, ptr noundef @.str.23, ptr noundef null)
  store ptr %247, ptr %21, align 8, !tbaa !9
  %248 = load ptr, ptr %21, align 8, !tbaa !9
  %249 = icmp ne ptr %248, null
  br i1 %249, label %250, label %257

250:                                              ; preds = %243
  %251 = load ptr, ptr %21, align 8, !tbaa !9
  %252 = getelementptr inbounds %struct.xjson_writer_, ptr %20, i32 0, i32 7
  %253 = load ptr, ptr %252, align 8, !tbaa !19
  %254 = getelementptr inbounds %struct.xjson_writer_, ptr %20, i32 0, i32 4
  %255 = load i64, ptr %254, align 8, !tbaa !20
  %256 = call i32 @XFile_Write(ptr noundef %251, ptr noundef %253, i64 noundef %255)
  call void @XFile_Free(ptr noundef %21)
  br label %257

257:                                              ; preds = %250, %243
  call void @XJSON_DestroyWriter(ptr noundef %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %258

258:                                              ; preds = %257, %236
  %259 = load ptr, ptr %10, align 8, !tbaa !9
  call void @XJSON_FreeObject(ptr noundef %259)
  call void @llvm.lifetime.end.p0(i64 168, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %260

260:                                              ; preds = %258, %51
  %261 = load ptr, ptr %9, align 8, !tbaa !9
  call void @XPool_Reset(ptr noundef %261)
  call void @llvm.lifetime.start.p0(i64 72, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %262 = load ptr, ptr %5, align 8, !tbaa !9
  %263 = getelementptr inbounds ptr, ptr %262, i64 1
  %264 = load ptr, ptr %263, align 8, !tbaa !9
  %265 = call ptr @XPath_Load(ptr noundef %264, ptr noundef %23)
  store ptr %265, ptr %24, align 8, !tbaa !9
  %266 = load ptr, ptr %24, align 8, !tbaa !9
  %267 = icmp eq ptr %266, null
  br i1 %267, label %268, label %273

268:                                              ; preds = %260
  %269 = load ptr, ptr %5, align 8, !tbaa !9
  %270 = getelementptr inbounds ptr, ptr %269, i64 1
  %271 = load ptr, ptr %270, align 8, !tbaa !9
  %272 = call ptr @XSTR_Error()
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.24, ptr noundef %271, ptr noundef %272)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %455

273:                                              ; preds = %260
  %274 = load ptr, ptr %9, align 8, !tbaa !9
  %275 = load ptr, ptr %24, align 8, !tbaa !9
  %276 = load i64, ptr %23, align 8, !tbaa !21
  %277 = call i32 @XJSON_Parse(ptr noundef %22, ptr noundef %274, ptr noundef %275, i64 noundef %276)
  %278 = icmp ne i32 %277, 0
  br i1 %278, label %284, label %279

279:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 4098, ptr %25) #5
  %280 = getelementptr inbounds [4098 x i8], ptr %25, i64 0, i64 0
  %281 = call i64 @XJSON_GetErrorStr(ptr noundef %22, ptr noundef %280, i64 noundef 4098)
  %282 = getelementptr inbounds [4098 x i8], ptr %25, i64 0, i64 0
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.25, ptr noundef %282)
  call void @XJSON_Destroy(ptr noundef %22)
  %283 = load ptr, ptr %24, align 8, !tbaa !9
  call void @free(ptr noundef %283) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4098, ptr %25) #5
  br label %455

284:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %285 = getelementptr inbounds %struct.xjson_, ptr %22, i32 0, i32 2
  %286 = load ptr, ptr %285, align 8, !tbaa !22
  %287 = call ptr @XJSON_GetArrayItem(ptr noundef %286, i64 noundef 0)
  %288 = call ptr @XJSON_GetObject(ptr noundef %287, ptr noundef @.str.1)
  store ptr %288, ptr %26, align 8, !tbaa !9
  %289 = load ptr, ptr %26, align 8, !tbaa !9
  %290 = icmp ne ptr %289, null
  br i1 %290, label %291, label %433

291:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %292 = load ptr, ptr %26, align 8, !tbaa !9
  %293 = call ptr @XJSON_GetObject(ptr noundef %292, ptr noundef @.str.2)
  store ptr %293, ptr %27, align 8, !tbaa !9
  %294 = load ptr, ptr %27, align 8, !tbaa !9
  %295 = icmp ne ptr %294, null
  br i1 %295, label %296, label %339

296:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %297 = load ptr, ptr %27, align 8, !tbaa !9
  %298 = call ptr @XJSON_GetObject(ptr noundef %297, ptr noundef @.str.10)
  store ptr %298, ptr %28, align 8, !tbaa !9
  %299 = load ptr, ptr %28, align 8, !tbaa !9
  %300 = icmp ne ptr %299, null
  br i1 %300, label %301, label %304

301:                                              ; preds = %296
  %302 = load ptr, ptr %28, align 8, !tbaa !9
  %303 = call i32 @XJSON_GetInt(ptr noundef %302)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.26, i32 noundef %303)
  br label %304

304:                                              ; preds = %301, %296
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %305 = load ptr, ptr %27, align 8, !tbaa !9
  %306 = call ptr @XJSON_GetObject(ptr noundef %305, ptr noundef @.str.9)
  store ptr %306, ptr %29, align 8, !tbaa !9
  %307 = load ptr, ptr %29, align 8, !tbaa !9
  %308 = icmp ne ptr %307, null
  br i1 %308, label %309, label %312

309:                                              ; preds = %304
  %310 = load ptr, ptr %29, align 8, !tbaa !9
  %311 = call double @XJSON_GetFloat(ptr noundef %310)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.27, double noundef %311)
  br label %312

312:                                              ; preds = %309, %304
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %313 = load ptr, ptr %27, align 8, !tbaa !9
  %314 = call ptr @XJSON_GetObject(ptr noundef %313, ptr noundef @.str.3)
  store ptr %314, ptr %30, align 8, !tbaa !9
  %315 = load ptr, ptr %30, align 8, !tbaa !9
  %316 = icmp ne ptr %315, null
  br i1 %316, label %317, label %338

317:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %318 = load ptr, ptr %30, align 8, !tbaa !9
  %319 = call ptr @XJSON_GetObject(ptr noundef %318, ptr noundef @.str.4)
  store ptr %319, ptr %31, align 8, !tbaa !9
  %320 = load ptr, ptr %31, align 8, !tbaa !9
  %321 = icmp ne ptr %320, null
  br i1 %321, label %322, label %329

322:                                              ; preds = %317
  %323 = load ptr, ptr %31, align 8, !tbaa !9
  %324 = call zeroext i8 @XJSON_GetBool(ptr noundef %323)
  %325 = zext i8 %324 to i32
  %326 = icmp ne i32 %325, 0
  %327 = zext i1 %326 to i64
  %328 = select i1 %326, ptr @.str.29, ptr @.str.30
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.28, ptr noundef %328)
  br label %329

329:                                              ; preds = %322, %317
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %330 = load ptr, ptr %30, align 8, !tbaa !9
  %331 = call ptr @XJSON_GetObject(ptr noundef %330, ptr noundef @.str.7)
  store ptr %331, ptr %32, align 8, !tbaa !9
  %332 = load ptr, ptr %32, align 8, !tbaa !9
  %333 = icmp ne ptr %332, null
  br i1 %333, label %334, label %337

334:                                              ; preds = %329
  %335 = load ptr, ptr %32, align 8, !tbaa !9
  %336 = call ptr @XJSON_GetString(ptr noundef %335)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.31, ptr noundef %336)
  br label %337

337:                                              ; preds = %334, %329
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %338

338:                                              ; preds = %337, %312
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %339

339:                                              ; preds = %338, %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %340 = load ptr, ptr %26, align 8, !tbaa !9
  %341 = call ptr @XJSON_GetObject(ptr noundef %340, ptr noundef @.str.16)
  store ptr %341, ptr %33, align 8, !tbaa !9
  %342 = load ptr, ptr %33, align 8, !tbaa !9
  %343 = icmp ne ptr %342, null
  br i1 %343, label %344, label %379

344:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %345 = load ptr, ptr %33, align 8, !tbaa !9
  %346 = call i64 @XJSON_GetArrayLength(ptr noundef %345)
  store i64 %346, ptr %35, align 8, !tbaa !21
  store i64 0, ptr %34, align 8, !tbaa !21
  br label %347

347:                                              ; preds = %375, %344
  %348 = load i64, ptr %34, align 8, !tbaa !21
  %349 = load i64, ptr %35, align 8, !tbaa !21
  %350 = icmp ult i64 %348, %349
  br i1 %350, label %351, label %378

351:                                              ; preds = %347
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %352 = load ptr, ptr %33, align 8, !tbaa !9
  %353 = load i64, ptr %34, align 8, !tbaa !21
  %354 = call ptr @XJSON_GetArrayItem(ptr noundef %352, i64 noundef %353)
  store ptr %354, ptr %36, align 8, !tbaa !9
  %355 = load ptr, ptr %36, align 8, !tbaa !9
  %356 = icmp ne ptr %355, null
  br i1 %356, label %357, label %374

357:                                              ; preds = %351
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %358 = load ptr, ptr %36, align 8, !tbaa !9
  %359 = call ptr @XJSON_GetObject(ptr noundef %358, ptr noundef @.str.18)
  store ptr %359, ptr %37, align 8, !tbaa !9
  %360 = load ptr, ptr %37, align 8, !tbaa !9
  %361 = icmp ne ptr %360, null
  br i1 %361, label %362, label %365

362:                                              ; preds = %357
  %363 = load ptr, ptr %37, align 8, !tbaa !9
  %364 = call i32 @XJSON_GetInt(ptr noundef %363)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.32, i32 noundef %364)
  br label %365

365:                                              ; preds = %362, %357
  %366 = load ptr, ptr %36, align 8, !tbaa !9
  %367 = call ptr @XJSON_GetObject(ptr noundef %366, ptr noundef @.str.17)
  store ptr %367, ptr %37, align 8, !tbaa !9
  %368 = load ptr, ptr %37, align 8, !tbaa !9
  %369 = icmp ne ptr %368, null
  br i1 %369, label %370, label %373

370:                                              ; preds = %365
  %371 = load ptr, ptr %37, align 8, !tbaa !9
  %372 = call double @XJSON_GetFloat(ptr noundef %371)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.33, double noundef %372)
  br label %373

373:                                              ; preds = %370, %365
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  br label %374

374:                                              ; preds = %373, %351
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  br label %375

375:                                              ; preds = %374
  %376 = load i64, ptr %34, align 8, !tbaa !21
  %377 = add i64 %376, 1
  store i64 %377, ptr %34, align 8, !tbaa !21
  br label %347, !llvm.loop !25

378:                                              ; preds = %347
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %379

379:                                              ; preds = %378, %339
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %380 = load ptr, ptr %26, align 8, !tbaa !9
  %381 = call ptr @XJSON_GetObject(ptr noundef %380, ptr noundef @.str.11)
  store ptr %381, ptr %38, align 8, !tbaa !9
  %382 = load ptr, ptr %38, align 8, !tbaa !9
  %383 = icmp ne ptr %382, null
  br i1 %383, label %384, label %432

384:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %385 = load ptr, ptr %38, align 8, !tbaa !9
  %386 = call ptr @XJSON_GetObject(ptr noundef %385, ptr noundef @.str.12)
  store ptr %386, ptr %39, align 8, !tbaa !9
  %387 = load ptr, ptr %39, align 8, !tbaa !9
  %388 = icmp ne ptr %387, null
  br i1 %388, label %389, label %411

389:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #5
  %390 = load ptr, ptr %39, align 8, !tbaa !9
  %391 = call i64 @XJSON_GetArrayLength(ptr noundef %390)
  store i64 %391, ptr %41, align 8, !tbaa !21
  store i64 0, ptr %40, align 8, !tbaa !21
  br label %392

392:                                              ; preds = %407, %389
  %393 = load i64, ptr %40, align 8, !tbaa !21
  %394 = load i64, ptr %41, align 8, !tbaa !21
  %395 = icmp ult i64 %393, %394
  br i1 %395, label %396, label %410

396:                                              ; preds = %392
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #5
  %397 = load ptr, ptr %39, align 8, !tbaa !9
  %398 = load i64, ptr %40, align 8, !tbaa !21
  %399 = call ptr @XJSON_GetArrayItem(ptr noundef %397, i64 noundef %398)
  store ptr %399, ptr %42, align 8, !tbaa !9
  %400 = load ptr, ptr %42, align 8, !tbaa !9
  %401 = icmp ne ptr %400, null
  br i1 %401, label %402, label %406

402:                                              ; preds = %396
  %403 = load ptr, ptr %42, align 8, !tbaa !9
  %404 = getelementptr inbounds %struct.xjson_obj_, ptr %403, i32 0, i32 5
  %405 = load ptr, ptr %404, align 8, !tbaa !27
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.34, ptr noundef %405)
  br label %406

406:                                              ; preds = %402, %396
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #5
  br label %407

407:                                              ; preds = %406
  %408 = load i64, ptr %40, align 8, !tbaa !21
  %409 = add i64 %408, 1
  store i64 %409, ptr %40, align 8, !tbaa !21
  br label %392, !llvm.loop !29

410:                                              ; preds = %392
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  br label %411

411:                                              ; preds = %410, %384
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #5
  %412 = load ptr, ptr %38, align 8, !tbaa !9
  %413 = call ptr @XJSON_GetObject(ptr noundef %412, ptr noundef @.str.15)
  store ptr %413, ptr %43, align 8, !tbaa !9
  %414 = load ptr, ptr %43, align 8, !tbaa !9
  %415 = icmp ne ptr %414, null
  br i1 %415, label %416, label %423

416:                                              ; preds = %411
  %417 = load ptr, ptr %43, align 8, !tbaa !9
  %418 = call zeroext i8 @XJSON_GetBool(ptr noundef %417)
  %419 = zext i8 %418 to i32
  %420 = icmp ne i32 %419, 0
  %421 = zext i1 %420 to i64
  %422 = select i1 %420, ptr @.str.29, ptr @.str.30
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.35, ptr noundef %422)
  br label %423

423:                                              ; preds = %416, %411
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #5
  %424 = load ptr, ptr %38, align 8, !tbaa !9
  %425 = call ptr @XJSON_GetObject(ptr noundef %424, ptr noundef @.str.13)
  store ptr %425, ptr %44, align 8, !tbaa !9
  %426 = load ptr, ptr %44, align 8, !tbaa !9
  %427 = icmp ne ptr %426, null
  br i1 %427, label %428, label %431

428:                                              ; preds = %423
  %429 = load ptr, ptr %44, align 8, !tbaa !9
  %430 = call ptr @XJSON_GetString(ptr noundef %429)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.36, ptr noundef %430)
  br label %431

431:                                              ; preds = %428, %423
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  br label %432

432:                                              ; preds = %431, %379
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %433

433:                                              ; preds = %432, %284
  %434 = load ptr, ptr %24, align 8, !tbaa !9
  %435 = load i64, ptr %23, align 8, !tbaa !21
  %436 = call i32 @XJSON_Write(ptr noundef %22, ptr noundef %434, i64 noundef %435)
  %437 = icmp ne i32 %436, 0
  br i1 %437, label %438, label %440

438:                                              ; preds = %433
  %439 = load ptr, ptr %24, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.37, ptr noundef %439)
  br label %440

440:                                              ; preds = %438, %433
  call void @llvm.lifetime.start.p0(i64 168, ptr %45) #5
  %441 = load ptr, ptr %9, align 8, !tbaa !9
  %442 = load i64, ptr %23, align 8, !tbaa !21
  %443 = call i32 @XJSON_InitWriter(ptr noundef %45, ptr noundef %441, ptr noundef null, i64 noundef %442)
  %444 = getelementptr inbounds %struct.xjson_writer_, ptr %45, i32 0, i32 2
  store i64 4, ptr %444, align 8, !tbaa !15
  %445 = getelementptr inbounds %struct.xjson_, ptr %22, i32 0, i32 2
  %446 = load ptr, ptr %445, align 8, !tbaa !22
  %447 = call i32 @XJSON_WriteObject(ptr noundef %446, ptr noundef %45)
  %448 = icmp ne i32 %447, 0
  br i1 %448, label %449, label %452

449:                                              ; preds = %440
  %450 = getelementptr inbounds %struct.xjson_writer_, ptr %45, i32 0, i32 7
  %451 = load ptr, ptr %450, align 8, !tbaa !19
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.38, ptr noundef %451)
  call void @XJSON_DestroyWriter(ptr noundef %45)
  br label %452

452:                                              ; preds = %449, %440
  call void @XJSON_Destroy(ptr noundef %22)
  %453 = load ptr, ptr %9, align 8, !tbaa !9
  call void @XPool_Destroy(ptr noundef %453)
  %454 = load ptr, ptr %24, align 8, !tbaa !9
  call void @free(ptr noundef %454) #5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 168, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %455

455:                                              ; preds = %452, %279, %268
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %22) #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 40, ptr %8) #5
  br label %456

456:                                              ; preds = %455, %50
  call void @llvm.lifetime.end.p0(i64 2600, ptr %6) #5
  %457 = load i32, ptr %3, align 4
  ret i32 %457
}

declare void @XLog_Init(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) #1

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

declare void @XLog_ConfigGet(ptr noundef) #1

declare void @XLog_ConfigSet(ptr noundef) #1

declare void @XLog_Display(i32 noundef, i8 noundef zeroext, ptr noundef, ...) #1

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

declare ptr @XJSON_NewArray(ptr noundef, ptr noundef, i8 noundef zeroext) #1

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

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

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

declare ptr @XJSON_NewString(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @XJSON_NewFloat(ptr noundef, ptr noundef, double noundef) #1

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

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

declare ptr @XJSON_NewNull(ptr noundef, ptr noundef) #1

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

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

declare ptr @XFile_Alloc(ptr noundef, ptr noundef, ptr noundef) #1

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

declare void @XFile_Free(ptr noundef) #1

declare void @XJSON_DestroyWriter(ptr noundef) #1

declare void @XJSON_FreeObject(ptr noundef) #1

declare void @XPool_Reset(ptr noundef) #1

declare ptr @XPath_Load(ptr noundef, ptr noundef) #1

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

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

declare void @XJSON_Destroy(ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare ptr @XJSON_GetObject(ptr noundef, ptr noundef) #1

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

declare i32 @XJSON_GetInt(ptr noundef) #1

declare double @XJSON_GetFloat(ptr noundef) #1

declare zeroext i8 @XJSON_GetBool(ptr noundef) #1

declare ptr @XJSON_GetString(ptr noundef) #1

declare i64 @XJSON_GetArrayLength(ptr noundef) #1

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

declare void @XPool_Destroy(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @XSTR_Error() #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 = { "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 "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 = { inlinehint 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 #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !7, i64 27}
!12 = !{!"XLogConfig", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !13, i64 32, !7, i64 34, !7, i64 290, !7, i64 2338}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !7, i64 31}
!15 = !{!16, !18, i64 104}
!16 = !{!"xjson_writer_", !17, i64 0, !7, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !18, i64 128, !18, i64 136, !10, i64 144, !10, i64 152, !7, i64 160}
!17 = !{!"xjson_format_", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!18 = !{!"long", !7, i64 0}
!19 = !{!16, !10, i64 144}
!20 = !{!16, !18, i64 120}
!21 = !{!18, !18, i64 0}
!22 = !{!23, !10, i64 32}
!23 = !{!"xjson_", !24, i64 0, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !18, i64 56, !18, i64 64}
!24 = !{!"xjson_token_", !6, i64 0, !10, i64 8, !18, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !10, i64 16}
!28 = !{!"xjson_obj_", !6, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !10, i64 8, !10, i64 16, !10, i64 24}
!29 = distinct !{!29, !26}


; 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.XLogConfig = type { i32, i32, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i16, [256 x i8], [2048 x i8], [256 x i8] }
%struct.XPool = type { ptr, ptr, i64, i64, i8 }
%struct.xjson_writer_ = type { %struct.xjson_format_, i8, i64, i64, i64, i64, i64, ptr, ptr, i8 }
%struct.xjson_format_ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.xjson_ = type { %struct.xjson_token_, i32, ptr, ptr, ptr, i64, i64 }
%struct.xjson_token_ = type { i32, ptr, i64 }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.XLogConfig, align 8
  %4 = alloca %struct.XPool, align 8
  %5 = alloca %struct.xjson_writer_, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.xjson_, align 8
  %8 = alloca i64, align 8
  %9 = alloca [4098 x i8], align 16
  %10 = alloca %struct.xjson_writer_, align 8
  tail call void @XLog_Init(ptr noundef null, i16 noundef zeroext 203, i8 noundef zeroext 0) #5
  call void @llvm.lifetime.start.p0(i64 2600, ptr nonnull %3) #5
  call void @XLog_ConfigGet(ptr noundef nonnull %3) #5
  %11 = getelementptr inbounds i8, ptr %3, i64 27
  store i8 1, ptr %11, align 1, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 31
  store i8 1, ptr %12, align 1, !tbaa !12
  call void @XLog_ConfigSet(ptr noundef nonnull %3) #5
  %13 = icmp slt i32 %0, 2
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str) #5
  br label %206

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  %16 = call i32 @XPool_Init(ptr noundef nonnull %4, i64 noundef 65536) #5
  %17 = call ptr @XJSON_NewArray(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %118, label %18

18:                                               ; preds = %15
  %19 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %.not185 = icmp eq ptr %19, null
  br i1 %.not185, label %102, label %20

20:                                               ; preds = %18
  %21 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i8 noundef zeroext 0) #5
  %.not186 = icmp eq ptr %21, null
  br i1 %.not186, label %100, label %22

22:                                               ; preds = %20
  %23 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef nonnull @.str.2, i8 noundef zeroext 0) #5
  %.not187 = icmp eq ptr %23, null
  br i1 %.not187, label %40, label %24

24:                                               ; preds = %22
  %25 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, i8 noundef zeroext 0) #5
  %.not188 = icmp eq ptr %25, null
  br i1 %.not188, label %34, label %26

26:                                               ; preds = %24
  %27 = call ptr @XJSON_NewBool(ptr noundef nonnull %4, ptr noundef nonnull @.str.4, i32 noundef 1) #5
  %28 = call i32 @XJSON_AddObject(ptr noundef nonnull %25, ptr noundef %27) #5
  %29 = call ptr @XJSON_NewString(ptr noundef nonnull %4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6) #5
  %30 = call i32 @XJSON_AddObject(ptr noundef nonnull %25, ptr noundef %29) #5
  %31 = call ptr @XJSON_NewString(ptr noundef nonnull %4, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8) #5
  %32 = call i32 @XJSON_AddObject(ptr noundef nonnull %25, ptr noundef %31) #5
  %33 = call i32 @XJSON_AddObject(ptr noundef nonnull %23, ptr noundef nonnull %25) #5
  br label %34

34:                                               ; preds = %26, %24
  %35 = call ptr @XJSON_NewFloat(ptr noundef nonnull %4, ptr noundef nonnull @.str.9, double noundef 0x404E733343FA2AD4) #5
  %36 = call i32 @XJSON_AddObject(ptr noundef nonnull %23, ptr noundef %35) #5
  %37 = call ptr @XJSON_NewInt(ptr noundef nonnull %4, ptr noundef nonnull @.str.10, i32 noundef 66) #5
  %38 = call i32 @XJSON_AddObject(ptr noundef nonnull %23, ptr noundef %37) #5
  %39 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef nonnull %23) #5
  br label %40

40:                                               ; preds = %34, %22
  %41 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef nonnull @.str.11, i8 noundef zeroext 0) #5
  %.not189 = icmp eq ptr %41, null
  br i1 %.not189, label %58, label %42

42:                                               ; preds = %40
  %43 = call ptr @XJSON_NewArray(ptr noundef nonnull %4, ptr noundef nonnull @.str.12, i8 noundef zeroext 0) #5
  %.not190 = icmp eq ptr %43, null
  br i1 %.not190, label %52, label %44

44:                                               ; preds = %42
  %45 = call ptr @XJSON_NewBool(ptr noundef nonnull %4, ptr noundef null, i32 noundef 1) #5
  %46 = call i32 @XJSON_AddObject(ptr noundef nonnull %43, ptr noundef %45) #5
  %47 = call ptr @XJSON_NewInt(ptr noundef nonnull %4, ptr noundef null, i32 noundef 69) #5
  %48 = call i32 @XJSON_AddObject(ptr noundef nonnull %43, ptr noundef %47) #5
  %49 = call ptr @XJSON_NewFloat(ptr noundef nonnull %4, ptr noundef null, double noundef 0x40517999A1FD156A) #5
  %50 = call i32 @XJSON_AddObject(ptr noundef nonnull %43, ptr noundef %49) #5
  %51 = call i32 @XJSON_AddObject(ptr noundef nonnull %41, ptr noundef nonnull %43) #5
  br label %52

52:                                               ; preds = %44, %42
  %53 = call ptr @XJSON_NewString(ptr noundef nonnull %4, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14) #5
  %54 = call i32 @XJSON_AddObject(ptr noundef nonnull %41, ptr noundef %53) #5
  %55 = call ptr @XJSON_NewBool(ptr noundef nonnull %4, ptr noundef nonnull @.str.15, i32 noundef 1) #5
  %56 = call i32 @XJSON_AddObject(ptr noundef nonnull %41, ptr noundef %55) #5
  %57 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef nonnull %41) #5
  br label %58

58:                                               ; preds = %52, %40
  %59 = call ptr @XJSON_NewArray(ptr noundef nonnull %4, ptr noundef nonnull @.str.16, i8 noundef zeroext 0) #5
  %.not191 = icmp eq ptr %59, null
  br i1 %.not191, label %86, label %60

60:                                               ; preds = %58
  %61 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %.not192 = icmp eq ptr %61, null
  br i1 %.not192, label %68, label %62

62:                                               ; preds = %60
  %63 = call ptr @XJSON_NewFloat(ptr noundef nonnull %4, ptr noundef nonnull @.str.17, double noundef 0x404EF33343FA2AD4) #5
  %64 = call i32 @XJSON_AddObject(ptr noundef nonnull %61, ptr noundef %63) #5
  %65 = call ptr @XJSON_NewInt(ptr noundef nonnull %4, ptr noundef nonnull @.str.18, i32 noundef -67) #5
  %66 = call i32 @XJSON_AddObject(ptr noundef nonnull %61, ptr noundef %65) #5
  %67 = call i32 @XJSON_AddObject(ptr noundef nonnull %59, ptr noundef nonnull %61) #5
  br label %68

68:                                               ; preds = %62, %60
  %69 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %.not193 = icmp eq ptr %69, null
  br i1 %.not193, label %76, label %70

70:                                               ; preds = %68
  %71 = call ptr @XJSON_NewFloat(ptr noundef nonnull %4, ptr noundef nonnull @.str.17, double noundef 0x404F733343FA2AD4) #5
  %72 = call i32 @XJSON_AddObject(ptr noundef nonnull %69, ptr noundef %71) #5
  %73 = call ptr @XJSON_NewInt(ptr noundef nonnull %4, ptr noundef nonnull @.str.18, i32 noundef 68) #5
  %74 = call i32 @XJSON_AddObject(ptr noundef nonnull %69, ptr noundef %73) #5
  %75 = call i32 @XJSON_AddObject(ptr noundef nonnull %59, ptr noundef nonnull %69) #5
  br label %76

76:                                               ; preds = %70, %68
  %77 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %.not194 = icmp eq ptr %77, null
  br i1 %.not194, label %84, label %78

78:                                               ; preds = %76
  %79 = call ptr @XJSON_NewFloat(ptr noundef nonnull %4, ptr noundef nonnull @.str.17, double noundef 0x404FFC1ECD75942C) #5
  %80 = call i32 @XJSON_AddObject(ptr noundef nonnull %77, ptr noundef %79) #5
  %81 = call ptr @XJSON_NewInt(ptr noundef nonnull %4, ptr noundef nonnull @.str.18, i32 noundef -69) #5
  %82 = call i32 @XJSON_AddObject(ptr noundef nonnull %77, ptr noundef %81) #5
  %83 = call i32 @XJSON_AddObject(ptr noundef nonnull %59, ptr noundef nonnull %77) #5
  br label %84

84:                                               ; preds = %78, %76
  %85 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef nonnull %59) #5
  br label %86

86:                                               ; preds = %84, %58
  %87 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef nonnull @.str.19, i8 noundef zeroext 0) #5
  %88 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef %87) #5
  %89 = call ptr @XJSON_NewArray(ptr noundef nonnull %4, ptr noundef nonnull @.str.20, i8 noundef zeroext 0) #5
  %90 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef %89) #5
  %91 = call ptr @XJSON_NewNull(ptr noundef nonnull %4, ptr noundef nonnull @.str.21) #5
  %92 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef %91) #5
  %93 = call ptr @XJSON_NewArray(ptr noundef nonnull %4, ptr noundef nonnull @.str.22, i8 noundef zeroext 0) #5
  %.not195 = icmp eq ptr %93, null
  br i1 %.not195, label %98, label %94

94:                                               ; preds = %86
  %95 = call ptr @XJSON_NewObject(ptr noundef nonnull %4, ptr noundef null, i8 noundef zeroext 0) #5
  %96 = call i32 @XJSON_AddObject(ptr noundef nonnull %93, ptr noundef %95) #5
  %97 = call i32 @XJSON_AddObject(ptr noundef nonnull %21, ptr noundef nonnull %93) #5
  br label %98

98:                                               ; preds = %94, %86
  %99 = call i32 @XJSON_AddObject(ptr noundef nonnull %19, ptr noundef nonnull %21) #5
  br label %100

100:                                              ; preds = %98, %20
  %101 = call i32 @XJSON_AddObject(ptr noundef nonnull %17, ptr noundef nonnull %19) #5
  br label %102

102:                                              ; preds = %100, %18
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %5) #5
  %103 = call i32 @XJSON_InitWriter(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef null, i64 noundef 1) #5
  %104 = getelementptr inbounds i8, ptr %5, i64 104
  store i64 4, ptr %104, align 8, !tbaa !13
  %105 = call i32 @XJSON_WriteObject(ptr noundef nonnull %17, ptr noundef nonnull %5) #5
  %.not196 = icmp eq i32 %105, 0
  br i1 %.not196, label %117, label %106

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %107 = getelementptr inbounds i8, ptr %1, i64 8
  %108 = load ptr, ptr %107, align 8, !tbaa !17
  %109 = call ptr @XFile_Alloc(ptr noundef %108, ptr noundef nonnull @.str.23, ptr noundef null) #5
  store ptr %109, ptr %6, align 8, !tbaa !17
  %.not197 = icmp eq ptr %109, null
  br i1 %.not197, label %116, label %110

110:                                              ; preds = %106
  %111 = getelementptr inbounds i8, ptr %5, i64 144
  %112 = load ptr, ptr %111, align 8, !tbaa !18
  %113 = getelementptr inbounds i8, ptr %5, i64 120
  %114 = load i64, ptr %113, align 8, !tbaa !19
  %115 = call i32 @XFile_Write(ptr noundef nonnull %109, ptr noundef %112, i64 noundef %114) #5
  call void @XFile_Free(ptr noundef nonnull %6) #5
  br label %116

116:                                              ; preds = %110, %106
  call void @XJSON_DestroyWriter(ptr noundef nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %117

117:                                              ; preds = %116, %102
  call void @XJSON_FreeObject(ptr noundef nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %5) #5
  br label %118

118:                                              ; preds = %117, %15
  call void @XPool_Reset(ptr noundef nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %119 = getelementptr inbounds i8, ptr %1, i64 8
  %120 = load ptr, ptr %119, align 8, !tbaa !17
  %121 = call ptr @XPath_Load(ptr noundef %120, ptr noundef nonnull %8) #5
  %122 = icmp eq ptr %121, null
  br i1 %122, label %123, label %126

123:                                              ; preds = %118
  %124 = load ptr, ptr %119, align 8, !tbaa !17
  %125 = call ptr @XSTR_Error()
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.24, ptr noundef %124, ptr noundef %125) #5
  br label %205

126:                                              ; preds = %118
  %127 = load i64, ptr %8, align 8, !tbaa !20
  %128 = call i32 @XJSON_Parse(ptr noundef nonnull %7, ptr noundef nonnull %4, ptr noundef nonnull %121, i64 noundef %127) #5
  %.not198 = icmp eq i32 %128, 0
  br i1 %.not198, label %129, label %131

129:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4098, ptr nonnull %9) #5
  %130 = call i64 @XJSON_GetErrorStr(ptr noundef nonnull %7, ptr noundef nonnull %9, i64 noundef 4098) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.25, ptr noundef nonnull %9) #5
  call void @XJSON_Destroy(ptr noundef nonnull %7) #5
  call void @free(ptr noundef nonnull %121) #5
  call void @llvm.lifetime.end.p0(i64 4098, ptr nonnull %9) #5
  br label %205

131:                                              ; preds = %126
  %132 = getelementptr inbounds i8, ptr %7, i64 32
  %133 = load ptr, ptr %132, align 8, !tbaa !21
  %134 = call ptr @XJSON_GetArrayItem(ptr noundef %133, i64 noundef 0) #5
  %135 = call ptr @XJSON_GetObject(ptr noundef %134, ptr noundef nonnull @.str.1) #5
  %.not199 = icmp eq ptr %135, null
  br i1 %.not199, label %191, label %136

136:                                              ; preds = %131
  %137 = call ptr @XJSON_GetObject(ptr noundef nonnull %135, ptr noundef nonnull @.str.2) #5
  %.not200 = icmp eq ptr %137, null
  br i1 %.not200, label %157, label %138

138:                                              ; preds = %136
  %139 = call ptr @XJSON_GetObject(ptr noundef nonnull %137, ptr noundef nonnull @.str.10) #5
  %.not201 = icmp eq ptr %139, null
  br i1 %.not201, label %142, label %140

140:                                              ; preds = %138
  %141 = call i32 @XJSON_GetInt(ptr noundef nonnull %139) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.26, i32 noundef %141) #5
  br label %142

142:                                              ; preds = %140, %138
  %143 = call ptr @XJSON_GetObject(ptr noundef nonnull %137, ptr noundef nonnull @.str.9) #5
  %.not202 = icmp eq ptr %143, null
  br i1 %.not202, label %146, label %144

144:                                              ; preds = %142
  %145 = call double @XJSON_GetFloat(ptr noundef nonnull %143) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.27, double noundef %145) #5
  br label %146

146:                                              ; preds = %144, %142
  %147 = call ptr @XJSON_GetObject(ptr noundef nonnull %137, ptr noundef nonnull @.str.3) #5
  %.not203 = icmp eq ptr %147, null
  br i1 %.not203, label %157, label %148

148:                                              ; preds = %146
  %149 = call ptr @XJSON_GetObject(ptr noundef nonnull %147, ptr noundef nonnull @.str.4) #5
  %.not204 = icmp eq ptr %149, null
  br i1 %.not204, label %153, label %150

150:                                              ; preds = %148
  %151 = call zeroext i8 @XJSON_GetBool(ptr noundef nonnull %149) #5
  %.not205 = icmp eq i8 %151, 0
  %152 = select i1 %.not205, ptr @.str.30, ptr @.str.29
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.28, ptr noundef nonnull %152) #5
  br label %153

153:                                              ; preds = %150, %148
  %154 = call ptr @XJSON_GetObject(ptr noundef nonnull %147, ptr noundef nonnull @.str.7) #5
  %.not206 = icmp eq ptr %154, null
  br i1 %.not206, label %157, label %155

155:                                              ; preds = %153
  %156 = call ptr @XJSON_GetString(ptr noundef nonnull %154) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.31, ptr noundef %156) #5
  br label %157

157:                                              ; preds = %146, %155, %153, %136
  %158 = call ptr @XJSON_GetObject(ptr noundef nonnull %135, ptr noundef nonnull @.str.16) #5
  %.not207 = icmp eq ptr %158, null
  br i1 %.not207, label %.loopexit219, label %159

159:                                              ; preds = %157
  %160 = call i64 @XJSON_GetArrayLength(ptr noundef nonnull %158) #5
  %.not223 = icmp eq i64 %160, 0
  br i1 %.not223, label %.loopexit219, label %.lr.ph

.lr.ph:                                           ; preds = %159, %170
  %.0153220 = phi i64 [ %171, %170 ], [ 0, %159 ]
  %161 = call ptr @XJSON_GetArrayItem(ptr noundef nonnull %158, i64 noundef %.0153220) #5
  %.not216 = icmp eq ptr %161, null
  br i1 %.not216, label %170, label %162

162:                                              ; preds = %.lr.ph
  %163 = call ptr @XJSON_GetObject(ptr noundef nonnull %161, ptr noundef nonnull @.str.18) #5
  %.not217 = icmp eq ptr %163, null
  br i1 %.not217, label %166, label %164

164:                                              ; preds = %162
  %165 = call i32 @XJSON_GetInt(ptr noundef nonnull %163) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.32, i32 noundef %165) #5
  br label %166

166:                                              ; preds = %164, %162
  %167 = call ptr @XJSON_GetObject(ptr noundef nonnull %161, ptr noundef nonnull @.str.17) #5
  %.not218 = icmp eq ptr %167, null
  br i1 %.not218, label %170, label %168

168:                                              ; preds = %166
  %169 = call double @XJSON_GetFloat(ptr noundef nonnull %167) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.33, double noundef %169) #5
  br label %170

170:                                              ; preds = %166, %168, %.lr.ph
  %171 = add nuw i64 %.0153220, 1
  %exitcond.not = icmp eq i64 %171, %160
  br i1 %exitcond.not, label %.loopexit219, label %.lr.ph, !llvm.loop !24

.loopexit219:                                     ; preds = %170, %159, %157
  %172 = call ptr @XJSON_GetObject(ptr noundef nonnull %135, ptr noundef nonnull @.str.11) #5
  %.not208 = icmp eq ptr %172, null
  br i1 %.not208, label %191, label %173

173:                                              ; preds = %.loopexit219
  %174 = call ptr @XJSON_GetObject(ptr noundef nonnull %172, ptr noundef nonnull @.str.12) #5
  %.not209 = icmp eq ptr %174, null
  br i1 %.not209, label %.loopexit, label %175

175:                                              ; preds = %173
  %176 = call i64 @XJSON_GetArrayLength(ptr noundef nonnull %174) #5
  %.not224 = icmp eq i64 %176, 0
  br i1 %.not224, label %.loopexit, label %.lr.ph222

.lr.ph222:                                        ; preds = %175, %181
  %.0154221 = phi i64 [ %182, %181 ], [ 0, %175 ]
  %177 = call ptr @XJSON_GetArrayItem(ptr noundef nonnull %174, i64 noundef %.0154221) #5
  %.not215 = icmp eq ptr %177, null
  br i1 %.not215, label %181, label %178

178:                                              ; preds = %.lr.ph222
  %179 = getelementptr inbounds i8, ptr %177, i64 16
  %180 = load ptr, ptr %179, align 8, !tbaa !26
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.34, ptr noundef %180) #5
  br label %181

181:                                              ; preds = %178, %.lr.ph222
  %182 = add nuw i64 %.0154221, 1
  %exitcond225.not = icmp eq i64 %182, %176
  br i1 %exitcond225.not, label %.loopexit, label %.lr.ph222, !llvm.loop !28

.loopexit:                                        ; preds = %181, %175, %173
  %183 = call ptr @XJSON_GetObject(ptr noundef nonnull %172, ptr noundef nonnull @.str.15) #5
  %.not210 = icmp eq ptr %183, null
  br i1 %.not210, label %187, label %184

184:                                              ; preds = %.loopexit
  %185 = call zeroext i8 @XJSON_GetBool(ptr noundef nonnull %183) #5
  %.not211 = icmp eq i8 %185, 0
  %186 = select i1 %.not211, ptr @.str.30, ptr @.str.29
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.35, ptr noundef nonnull %186) #5
  br label %187

187:                                              ; preds = %184, %.loopexit
  %188 = call ptr @XJSON_GetObject(ptr noundef nonnull %172, ptr noundef nonnull @.str.13) #5
  %.not212 = icmp eq ptr %188, null
  br i1 %.not212, label %191, label %189

189:                                              ; preds = %187
  %190 = call ptr @XJSON_GetString(ptr noundef nonnull %188) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.36, ptr noundef %190) #5
  br label %191

191:                                              ; preds = %.loopexit219, %189, %187, %131
  %192 = load i64, ptr %8, align 8, !tbaa !20
  %193 = call i32 @XJSON_Write(ptr noundef nonnull %7, ptr noundef nonnull %121, i64 noundef %192) #5
  %.not213 = icmp eq i32 %193, 0
  br i1 %.not213, label %195, label %194

194:                                              ; preds = %191
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.37, ptr noundef nonnull %121) #5
  br label %195

195:                                              ; preds = %194, %191
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %10) #5
  %196 = load i64, ptr %8, align 8, !tbaa !20
  %197 = call i32 @XJSON_InitWriter(ptr noundef nonnull %10, ptr noundef nonnull %4, ptr noundef null, i64 noundef %196) #5
  %198 = getelementptr inbounds i8, ptr %10, i64 104
  store i64 4, ptr %198, align 8, !tbaa !13
  %199 = load ptr, ptr %132, align 8, !tbaa !21
  %200 = call i32 @XJSON_WriteObject(ptr noundef %199, ptr noundef nonnull %10) #5
  %.not214 = icmp eq i32 %200, 0
  br i1 %.not214, label %204, label %201

201:                                              ; preds = %195
  %202 = getelementptr inbounds i8, ptr %10, i64 144
  %203 = load ptr, ptr %202, align 8, !tbaa !18
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.38, ptr noundef %203) #5
  call void @XJSON_DestroyWriter(ptr noundef nonnull %10) #5
  br label %204

204:                                              ; preds = %201, %195
  call void @XJSON_Destroy(ptr noundef nonnull %7) #5
  call void @XPool_Destroy(ptr noundef nonnull %4) #5
  call void @free(ptr noundef %121) #5
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %10) #5
  br label %205

205:                                              ; preds = %204, %129, %123
  %.0 = phi i32 [ 1, %123 ], [ 0, %204 ], [ 1, %129 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  br label %206

206:                                              ; preds = %205, %14
  %.1 = phi i32 [ 1, %14 ], [ %.0, %205 ]
  call void @llvm.lifetime.end.p0(i64 2600, ptr nonnull %3) #5
  ret i32 %.1
}

declare void @XLog_Init(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) 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

declare void @XLog_ConfigGet(ptr noundef) local_unnamed_addr #1

declare void @XLog_ConfigSet(ptr noundef) local_unnamed_addr #1

declare void @XLog_Display(i32 noundef, i8 noundef zeroext, ptr noundef, ...) local_unnamed_addr #1

declare i32 @XPool_Init(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

declare ptr @XJSON_NewString(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @XJSON_NewFloat(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #1

declare ptr @XJSON_NewInt(ptr noundef, ptr noundef, i32 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) #2

declare ptr @XJSON_NewNull(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XJSON_InitWriter(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare ptr @XFile_Alloc(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XFile_Write(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @XFile_Free(ptr noundef) local_unnamed_addr #1

declare void @XJSON_DestroyWriter(ptr noundef) local_unnamed_addr #1

declare void @XJSON_FreeObject(ptr noundef) local_unnamed_addr #1

declare void @XPool_Reset(ptr noundef) local_unnamed_addr #1

declare ptr @XPath_Load(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @XJSON_Parse(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i64 @XJSON_GetErrorStr(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @XJSON_Destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare ptr @XJSON_GetObject(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @XJSON_GetArrayItem(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @XJSON_GetInt(ptr noundef) local_unnamed_addr #1

declare double @XJSON_GetFloat(ptr noundef) local_unnamed_addr #1

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

declare ptr @XJSON_GetString(ptr noundef) local_unnamed_addr #1

declare i64 @XJSON_GetArrayLength(ptr noundef) local_unnamed_addr #1

declare i32 @XJSON_Write(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @XPool_Destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @XSTR_Error() 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 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 #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, !8, i64 27}
!6 = !{!"XLogConfig", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !8, i64 24, !8, i64 25, !8, i64 26, !8, i64 27, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !11, i64 32, !8, i64 34, !8, i64 290, !8, i64 2338}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!6, !8, i64 31}
!13 = !{!14, !16, i64 104}
!14 = !{!"xjson_writer_", !15, i64 0, !8, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !10, i64 144, !10, i64 152, !8, i64 160}
!15 = !{!"xjson_format_", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!16 = !{!"long", !8, i64 0}
!17 = !{!10, !10, i64 0}
!18 = !{!14, !10, i64 144}
!19 = !{!14, !16, i64 120}
!20 = !{!16, !16, i64 0}
!21 = !{!22, !10, i64 32}
!22 = !{!"xjson_", !23, i64 0, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !16, i64 56, !16, i64 64}
!23 = !{!"xjson_token_", !7, i64 0, !10, i64 8, !16, i64 16}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 16}
!27 = !{!"xjson_obj_", !7, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !10, i64 8, !10, i64 16, !10, i64 24}
!28 = distinct !{!28, !25}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass