; LLVM IR from sylefeb/Silixel :: src/fstapi (fstapi)

; 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.fstWriterContext = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, i32, ptr, i32, i32, i32, i8, i64, i64, i32, i32, i64, i64, i32, i32, i32, i64, i32, double, ptr, ptr, i32, i64, i8, i8, i8, i8, i8, i64, i64, i64, i64, i64, i32, ptr, i32, i8, ptr, ptr, ptr, ptr, i32 }

@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: nounwind uwtable
declare dso_local void @fstWriterSetAttrBegin(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef) #7

; Function Attrs: nounwind uwtable
define dso_local i32 @fstWriterCreateEnumTable(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #7 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca [16 x i8], align 16
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store ptr null, ptr %23, align 8, !tbaa !5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %288

27:                                               ; preds = %6
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %288

30:                                               ; preds = %27
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %288

33:                                               ; preds = %30
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %288

36:                                               ; preds = %33
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %288

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call i64 @strlen(ptr noundef %40) #9
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %18, align 4, !tbaa !9
  %43 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %43, i64 noundef 16, ptr noundef @.str.14, i32 noundef %44) #8
  store i32 %45, ptr %20, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = call noalias ptr @calloc(i64 noundef %47, i64 noundef 4) #10
  store ptr %48, ptr %14, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = call noalias ptr @calloc(i64 noundef %50, i64 noundef 4) #10
  store ptr %51, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %127, %39
  %53 = load i32, ptr %24, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp ult i32 %53, %54
  br i1 %55, label %56, label %130

56:                                               ; preds = %52
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = load i32, ptr %24, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = call i64 @strlen(ptr noundef %61) #9
  %63 = trunc i64 %62 to i32
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = load i32, ptr %24, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !9
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load i32, ptr %24, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %68, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = load i32, ptr %24, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %73, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = call i32 @fstUtilityBinToEscConvertedLen(ptr noundef %72, i32 noundef %77)
  %79 = load i32, ptr %16, align 4, !tbaa !9
  %80 = add nsw i32 %79, %78
  store i32 %80, ptr %16, align 4, !tbaa !9
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = load i32, ptr %24, align 4, !tbaa !9
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = call i64 @strlen(ptr noundef %85) #9
  %87 = trunc i64 %86 to i32
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = load i32, ptr %24, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  store i32 %87, ptr %91, align 4, !tbaa !9
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load i32, ptr %24, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load i32, ptr %24, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = call i32 @fstUtilityBinToEscConvertedLen(ptr noundef %96, i32 noundef %101)
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = add nsw i32 %103, %102
  store i32 %104, ptr %17, align 4, !tbaa !9
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = icmp ugt i32 %105, 0
  br i1 %106, label %107, label %126

107:                                              ; preds = %56
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = load i32, ptr %24, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %108, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = icmp ult i32 %112, %113
  br i1 %114, label %115, label %125

115:                                              ; preds = %107
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = load ptr, ptr %15, align 8, !tbaa !5
  %118 = load i32, ptr %24, align 4, !tbaa !9
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = sub i32 %116, %121
  %123 = load i32, ptr %17, align 4, !tbaa !9
  %124 = add i32 %123, %122
  store i32 %124, ptr %17, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %115, %107
  br label %126

126:                                              ; preds = %125, %56
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %24, align 4, !tbaa !9
  %129 = add i32 %128, 1
  store i32 %129, ptr %24, align 4, !tbaa !9
  br label %52, !llvm.loop !11

130:                                              ; preds = %52
  %131 = load i32, ptr %18, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  %133 = load i32, ptr %20, align 4, !tbaa !9
  %134 = add nsw i32 %132, %133
  %135 = add nsw i32 %134, 1
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = add nsw i32 %135, %136
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = add i32 %137, %138
  %140 = load i32, ptr %17, align 4, !tbaa !9
  %141 = add i32 %139, %140
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = add i32 %141, %142
  store i32 %143, ptr %21, align 4, !tbaa !9
  %144 = load i32, ptr %21, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = call noalias ptr @malloc(i64 noundef %145) #11
  store ptr %146, ptr %23, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !9
  %147 = load ptr, ptr %23, align 8, !tbaa !5
  %148 = load i32, ptr %22, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = load i32, ptr %18, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %150, ptr align 1 %151, i64 %153, i1 false)
  %154 = load i32, ptr %18, align 4, !tbaa !9
  %155 = load i32, ptr %22, align 4, !tbaa !9
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %22, align 4, !tbaa !9
  %157 = load ptr, ptr %23, align 8, !tbaa !5
  %158 = load i32, ptr %22, align 4, !tbaa !9
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %22, align 4, !tbaa !9
  %160 = sext i32 %158 to i64
  %161 = getelementptr inbounds i8, ptr %157, i64 %160
  store i8 32, ptr %161, align 1, !tbaa !13
  %162 = load ptr, ptr %23, align 8, !tbaa !5
  %163 = load i32, ptr %22, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i8, ptr %162, i64 %164
  %166 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %167 = load i32, ptr %20, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %165, ptr align 16 %166, i64 %168, i1 false)
  %169 = load i32, ptr %20, align 4, !tbaa !9
  %170 = load i32, ptr %22, align 4, !tbaa !9
  %171 = add nsw i32 %170, %169
  store i32 %171, ptr %22, align 4, !tbaa !9
  %172 = load ptr, ptr %23, align 8, !tbaa !5
  %173 = load i32, ptr %22, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %22, align 4, !tbaa !9
  %175 = sext i32 %173 to i64
  %176 = getelementptr inbounds i8, ptr %172, i64 %175
  store i8 32, ptr %176, align 1, !tbaa !13
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %204, %130
  %178 = load i32, ptr %24, align 4, !tbaa !9
  %179 = load i32, ptr %9, align 4, !tbaa !9
  %180 = icmp ult i32 %178, %179
  br i1 %180, label %181, label %207

181:                                              ; preds = %177
  %182 = load ptr, ptr %23, align 8, !tbaa !5
  %183 = load i32, ptr %22, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds i8, ptr %182, i64 %184
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = load i32, ptr %24, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds ptr, ptr %186, i64 %188
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = load ptr, ptr %14, align 8, !tbaa !5
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds i32, ptr %191, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !9
  %196 = call i32 @fstUtilityBinToEsc(ptr noundef %185, ptr noundef %190, i32 noundef %195)
  %197 = load i32, ptr %22, align 4, !tbaa !9
  %198 = add nsw i32 %197, %196
  store i32 %198, ptr %22, align 4, !tbaa !9
  %199 = load ptr, ptr %23, align 8, !tbaa !5
  %200 = load i32, ptr %22, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %22, align 4, !tbaa !9
  %202 = sext i32 %200 to i64
  %203 = getelementptr inbounds i8, ptr %199, i64 %202
  store i8 32, ptr %203, align 1, !tbaa !13
  br label %204

204:                                              ; preds = %181
  %205 = load i32, ptr %24, align 4, !tbaa !9
  %206 = add i32 %205, 1
  store i32 %206, ptr %24, align 4, !tbaa !9
  br label %177, !llvm.loop !14

207:                                              ; preds = %177
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %269, %207
  %209 = load i32, ptr %24, align 4, !tbaa !9
  %210 = load i32, ptr %9, align 4, !tbaa !9
  %211 = icmp ult i32 %209, %210
  br i1 %211, label %212, label %272

212:                                              ; preds = %208
  %213 = load i32, ptr %10, align 4, !tbaa !9
  %214 = icmp ugt i32 %213, 0
  br i1 %214, label %215, label %246

215:                                              ; preds = %212
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = load i32, ptr %24, align 4, !tbaa !9
  %218 = zext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr %216, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !9
  %221 = load i32, ptr %10, align 4, !tbaa !9
  %222 = icmp ult i32 %220, %221
  br i1 %222, label %223, label %245

223:                                              ; preds = %215
  %224 = load ptr, ptr %23, align 8, !tbaa !5
  %225 = load i32, ptr %22, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i8, ptr %224, i64 %226
  %228 = load i32, ptr %10, align 4, !tbaa !9
  %229 = load ptr, ptr %15, align 8, !tbaa !5
  %230 = load i32, ptr %24, align 4, !tbaa !9
  %231 = zext i32 %230 to i64
  %232 = getelementptr inbounds i32, ptr %229, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !9
  %234 = sub i32 %228, %233
  %235 = zext i32 %234 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %227, i8 48, i64 %235, i1 false)
  %236 = load i32, ptr %10, align 4, !tbaa !9
  %237 = load ptr, ptr %15, align 8, !tbaa !5
  %238 = load i32, ptr %24, align 4, !tbaa !9
  %239 = zext i32 %238 to i64
  %240 = getelementptr inbounds i32, ptr %237, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !9
  %242 = sub i32 %236, %241
  %243 = load i32, ptr %22, align 4, !tbaa !9
  %244 = add i32 %243, %242
  store i32 %244, ptr %22, align 4, !tbaa !9
  br label %245

245:                                              ; preds = %223, %215
  br label %246

246:                                              ; preds = %245, %212
  %247 = load ptr, ptr %23, align 8, !tbaa !5
  %248 = load i32, ptr %22, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i8, ptr %247, i64 %249
  %251 = load ptr, ptr %12, align 8, !tbaa !5
  %252 = load i32, ptr %24, align 4, !tbaa !9
  %253 = zext i32 %252 to i64
  %254 = getelementptr inbounds ptr, ptr %251, i64 %253
  %255 = load ptr, ptr %254, align 8, !tbaa !5
  %256 = load ptr, ptr %15, align 8, !tbaa !5
  %257 = load i32, ptr %24, align 4, !tbaa !9
  %258 = zext i32 %257 to i64
  %259 = getelementptr inbounds i32, ptr %256, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !9
  %261 = call i32 @fstUtilityBinToEsc(ptr noundef %250, ptr noundef %255, i32 noundef %260)
  %262 = load i32, ptr %22, align 4, !tbaa !9
  %263 = add nsw i32 %262, %261
  store i32 %263, ptr %22, align 4, !tbaa !9
  %264 = load ptr, ptr %23, align 8, !tbaa !5
  %265 = load i32, ptr %22, align 4, !tbaa !9
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %22, align 4, !tbaa !9
  %267 = sext i32 %265 to i64
  %268 = getelementptr inbounds i8, ptr %264, i64 %267
  store i8 32, ptr %268, align 1, !tbaa !13
  br label %269

269:                                              ; preds = %246
  %270 = load i32, ptr %24, align 4, !tbaa !9
  %271 = add i32 %270, 1
  store i32 %271, ptr %24, align 4, !tbaa !9
  br label %208, !llvm.loop !15

272:                                              ; preds = %208
  %273 = load ptr, ptr %23, align 8, !tbaa !5
  %274 = load i32, ptr %22, align 4, !tbaa !9
  %275 = sub nsw i32 %274, 1
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds i8, ptr %273, i64 %276
  store i8 0, ptr %277, align 1, !tbaa !13
  %278 = load ptr, ptr %7, align 8, !tbaa !5
  %279 = load ptr, ptr %23, align 8, !tbaa !5
  %280 = load ptr, ptr %7, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.fstWriterContext, ptr %280, i32 0, i32 51
  %282 = load i32, ptr %281, align 8, !tbaa !16
  %283 = add i32 %282, 1
  store i32 %283, ptr %281, align 8, !tbaa !16
  store i32 %283, ptr %13, align 4, !tbaa !9
  %284 = zext i32 %283 to i64
  call void @fstWriterSetAttrBegin(ptr noundef %278, i32 noundef 0, i32 noundef 7, ptr noundef %279, i64 noundef %284)
  %285 = load ptr, ptr %23, align 8, !tbaa !5
  call void @free(ptr noundef %285) #8
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %286) #8
  %287 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %287) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %288

288:                                              ; preds = %272, %36, %33, %30, %27, %6
  %289 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  ret i32 %289
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @fstUtilityBinToEscConvertedLen(ptr noundef, i32 noundef) #7

; Function Attrs: nounwind uwtable
declare dso_local i32 @fstUtilityBinToEsc(ptr noundef, ptr noundef, i32 noundef) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !10, i64 336}
!17 = !{!"fstWriterContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !6, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 116, !10, i64 116, !10, i64 116, !18, i64 120, !18, i64 128, !10, i64 136, !10, i64 140, !18, i64 144, !18, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !18, i64 176, !10, i64 184, !19, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !18, i64 224, !7, i64 232, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !7, i64 234, !7, i64 235, !10, i64 236, !18, i64 240, !18, i64 248, !18, i64 256, !18, i64 264, !18, i64 272, !10, i64 280, !6, i64 288, !10, i64 296, !10, i64 300, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !10, i64 336}
!18 = !{!"long", !7, i64 0}
!19 = !{!"double", !7, i64 0}


; 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.14 = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 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 #2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nounwind uwtable
declare dso_local void @fstWriterSetAttrBegin(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
define dso_local i32 @fstWriterCreateEnumTable(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2, i32 noundef %3, ptr noundef readonly %4, ptr noundef readonly %5) local_unnamed_addr #8 {
  %7 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #10
  %8 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %9 = insertelement <4 x ptr> %8, ptr %1, i64 1
  %10 = insertelement <4 x ptr> %9, ptr %4, i64 2
  %11 = insertelement <4 x ptr> %10, ptr %5, i64 3
  %12 = icmp ne i32 %2, 0
  %13 = icmp eq <4 x ptr> %11, zeroinitializer
  %14 = bitcast <4 x i1> %13 to i4
  %15 = icmp eq i4 %14, 0
  %op.rdx = and i1 %15, %12
  br i1 %op.rdx, label %16, label %104

16:                                               ; preds = %6
  %17 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #11
  %18 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %7, i64 noundef 16, ptr noundef nonnull @.str.14, i32 noundef %2) #10
  %19 = zext i32 %2 to i64
  %20 = tail call noalias ptr @calloc(i64 noundef %19, i64 noundef 4) #12
  %21 = tail call noalias ptr @calloc(i64 noundef %19, i64 noundef 4) #12
  br label %22

22:                                               ; preds = %16, %22
  %indvars.iv = phi i64 [ 0, %16 ], [ %indvars.iv.next, %22 ]
  %.0116131 = phi i32 [ 0, %16 ], [ %.1117, %22 ]
  %.0118130 = phi i32 [ 0, %16 ], [ %29, %22 ]
  %23 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %24) #11
  %26 = trunc i64 %25 to i32
  %27 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  store i32 %26, ptr %27, align 4, !tbaa !9
  %28 = tail call i32 @fstUtilityBinToEscConvertedLen(ptr noundef %24, i32 noundef %26)
  %29 = add nsw i32 %28, %.0118130
  %30 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %31) #11
  %33 = trunc i64 %32 to i32
  %34 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  store i32 %33, ptr %34, align 4, !tbaa !9
  %35 = tail call i32 @fstUtilityBinToEscConvertedLen(ptr noundef %31, i32 noundef %33)
  %36 = add nsw i32 %35, %.0116131
  %37 = tail call i32 @llvm.usub.sat.i32(i32 %3, i32 %33)
  %.1117 = add i32 %36, %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %19
  br i1 %exitcond.not, label %38, label %22, !llvm.loop !11

38:                                               ; preds = %22
  %39 = trunc i64 %17 to i32
  %40 = add nsw i32 %39, 1
  %41 = add nsw i32 %40, %18
  %42 = add nsw i32 %41, 1
  %factor = shl i32 %2, 1
  %43 = add i32 %42, %factor
  %44 = add i32 %43, %29
  %45 = add i32 %44, %.1117
  %46 = sext i32 %45 to i64
  %47 = tail call noalias ptr @malloc(i64 noundef %46) #13
  %sext = shl i64 %17, 32
  %48 = ashr exact i64 %sext, 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %47, ptr nonnull align 1 %1, i64 %48, i1 false)
  %49 = getelementptr inbounds i8, ptr %47, i64 %48
  store i8 32, ptr %49, align 1, !tbaa !13
  %50 = sext i32 %40 to i64
  %51 = getelementptr inbounds i8, ptr %47, i64 %50
  %52 = sext i32 %18 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %51, ptr nonnull align 16 %7, i64 %52, i1 false)
  %53 = sext i32 %41 to i64
  %54 = getelementptr inbounds i8, ptr %47, i64 %53
  store i8 32, ptr %54, align 1, !tbaa !13
  br label %66

.preheader:                                       ; preds = %66
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %.preheader.split.us
  %indvars.iv152 = phi i64 [ %indvars.iv.next153, %.preheader.split.us ], [ 0, %.preheader ]
  %.1113135.us = phi i32 [ %63, %.preheader.split.us ], [ %75, %.preheader ]
  %55 = sext i32 %.1113135.us to i64
  %56 = getelementptr inbounds i8, ptr %47, i64 %55
  %57 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv152
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv152
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = tail call i32 @fstUtilityBinToEsc(ptr noundef %56, ptr noundef %58, i32 noundef %60)
  %62 = add nsw i32 %61, %.1113135.us
  %63 = add nsw i32 %62, 1
  %64 = sext i32 %62 to i64
  %65 = getelementptr inbounds i8, ptr %47, i64 %64
  store i8 32, ptr %65, align 1, !tbaa !13
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %exitcond156.not = icmp eq i64 %indvars.iv.next153, %19
  br i1 %exitcond156.not, label %.split.us, label %.preheader.split.us, !llvm.loop !14

66:                                               ; preds = %38, %66
  %indvars.iv142 = phi i64 [ 0, %38 ], [ %indvars.iv.next143, %66 ]
  %.0112133 = phi i32 [ %42, %38 ], [ %75, %66 ]
  %67 = sext i32 %.0112133 to i64
  %68 = getelementptr inbounds i8, ptr %47, i64 %67
  %69 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv142
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv142
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = tail call i32 @fstUtilityBinToEsc(ptr noundef %68, ptr noundef %70, i32 noundef %72)
  %74 = add nsw i32 %73, %.0112133
  %75 = add nsw i32 %74, 1
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds i8, ptr %47, i64 %76
  store i8 32, ptr %77, align 1, !tbaa !13
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %19
  br i1 %exitcond146.not, label %.preheader, label %66, !llvm.loop !15

.preheader.split:                                 ; preds = %.preheader, %87
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %87 ], [ 0, %.preheader ]
  %.1113135 = phi i32 [ %94, %87 ], [ %75, %.preheader ]
  %78 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv147
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = icmp ult i32 %79, %3
  br i1 %80, label %81, label %87

81:                                               ; preds = %.preheader.split
  %82 = sext i32 %.1113135 to i64
  %83 = getelementptr inbounds i8, ptr %47, i64 %82
  %84 = sub i32 %3, %79
  %85 = zext i32 %84 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %83, i8 48, i64 %85, i1 false)
  %86 = add i32 %84, %.1113135
  br label %87

87:                                               ; preds = %.preheader.split, %81
  %.2114 = phi i32 [ %86, %81 ], [ %.1113135, %.preheader.split ]
  %88 = sext i32 %.2114 to i64
  %89 = getelementptr inbounds i8, ptr %47, i64 %88
  %90 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv147
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = tail call i32 @fstUtilityBinToEsc(ptr noundef %89, ptr noundef %91, i32 noundef %79)
  %93 = add nsw i32 %92, %.2114
  %94 = add nsw i32 %93, 1
  %95 = sext i32 %93 to i64
  %96 = getelementptr inbounds i8, ptr %47, i64 %95
  store i8 32, ptr %96, align 1, !tbaa !13
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond151.not = icmp eq i64 %indvars.iv.next148, %19
  br i1 %exitcond151.not, label %.split.us, label %.preheader.split, !llvm.loop !14

.split.us:                                        ; preds = %87, %.preheader.split.us
  %.us-phi = phi i32 [ %63, %.preheader.split.us ], [ %94, %87 ]
  %97 = sext i32 %.us-phi to i64
  %98 = getelementptr i8, ptr %47, i64 %97
  %99 = getelementptr i8, ptr %98, i64 -1
  store i8 0, ptr %99, align 1, !tbaa !13
  %100 = getelementptr inbounds i8, ptr %0, i64 336
  %101 = load i32, ptr %100, align 8, !tbaa !16
  %102 = add i32 %101, 1
  store i32 %102, ptr %100, align 8, !tbaa !16
  %103 = zext i32 %102 to i64
  tail call void @fstWriterSetAttrBegin(ptr noundef nonnull %0, i32 noundef 0, i32 noundef 7, ptr noundef nonnull %47, i64 noundef %103)
  tail call void @free(ptr noundef nonnull %47) #10
  tail call void @free(ptr noundef nonnull %21) #10
  tail call void @free(ptr noundef %20) #10
  br label %104

104:                                              ; preds = %.split.us, %6
  %.0115 = phi i32 [ %102, %.split.us ], [ 0, %6 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #10
  ret i32 %.0115
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @fstUtilityBinToEscConvertedLen(ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare dso_local i32 @fstUtilityBinToEsc(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(0,1) }
attributes #13 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !10, i64 336}
!17 = !{!"fstWriterContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !6, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 116, !10, i64 116, !10, i64 116, !18, i64 120, !18, i64 128, !10, i64 136, !10, i64 140, !18, i64 144, !18, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !18, i64 176, !10, i64 184, !19, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !18, i64 224, !7, i64 232, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !10, i64 233, !7, i64 234, !7, i64 235, !10, i64 236, !18, i64 240, !18, i64 248, !18, i64 256, !18, i64 264, !18, i64 272, !10, i64 280, !6, i64 288, !10, i64 296, !10, i64 300, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !10, i64 336}
!18 = !{!"long", !7, i64 0}
!19 = !{!"double", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass