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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @fstDestroyMmaps(ptr noundef, i32 noundef) #2

declare i32 @fputc(i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i64 @fstFwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @fstWriterVarint(ptr noundef, i64 noundef) #2

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

21:                                               ; preds = %6
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %256

24:                                               ; preds = %21
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.fstWriterContext, ptr %25, i32 0, i32 8
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  call void @fstDestroyMmaps(ptr noundef %30, i32 noundef 0)
  br label %31

31:                                               ; preds = %29, %24
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.fstWriterContext, ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = call i32 @fputc(i32 noundef %32, ptr noundef %35)
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.fstWriterContext, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = call i32 @fputc(i32 noundef %37, ptr noundef %40)
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = call i64 @strlen(ptr noundef %42) #6
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %15, align 4, !tbaa !9
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = load i32, ptr %15, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.fstWriterContext, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = call i64 @fstFwrite(ptr noundef %45, i64 noundef %47, i64 noundef 1, ptr noundef %50)
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.fstWriterContext, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = call i32 @fputc(i32 noundef 0, ptr noundef %54)
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = add nsw i32 %56, 3
  %58 = sext i32 %57 to i64
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.fstWriterContext, ptr %59, i32 0, i32 7
  %61 = load i64, ptr %60, align 8, !tbaa !16
  %62 = add nsw i64 %61, %58
  store i64 %62, ptr %60, align 8, !tbaa !16
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 3
  br i1 %64, label %74, label %65

65:                                               ; preds = %31
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = icmp eq i32 %66, 4
  br i1 %67, label %74, label %68

68:                                               ; preds = %65
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 20
  br i1 %70, label %74, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 29
  br i1 %73, label %74, label %75

74:                                               ; preds = %71, %68, %65, %31
  store i32 1, ptr %16, align 4, !tbaa !9
  store i32 8, ptr %11, align 4, !tbaa !9
  br label %80

75:                                               ; preds = %71
  store i32 0, ptr %16, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = icmp eq i32 %76, 21
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %78, %75
  br label %80

80:                                               ; preds = %79, %74
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.fstWriterContext, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = call i32 @fstWriterVarint(ptr noundef %83, i64 noundef %85)
  %87 = sext i32 %86 to i64
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.fstWriterContext, ptr %88, i32 0, i32 7
  %90 = load i64, ptr %89, align 8, !tbaa !16
  %91 = add nsw i64 %90, %87
  store i64 %91, ptr %89, align 8, !tbaa !16
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.fstWriterContext, ptr %93, i32 0, i32 13
  %95 = load i32, ptr %94, align 8, !tbaa !17
  %96 = icmp ugt i32 %92, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %80
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %97, %80
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.fstWriterContext, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = call i32 @fstWriterVarint(ptr noundef %101, i64 noundef %103)
  %105 = sext i32 %104 to i64
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.fstWriterContext, ptr %106, i32 0, i32 7
  %108 = load i64, ptr %107, align 8, !tbaa !16
  %109 = add nsw i64 %108, %105
  store i64 %109, ptr %107, align 8, !tbaa !16
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.fstWriterContext, ptr %110, i32 0, i32 14
  %112 = load i32, ptr %111, align 4, !tbaa !18
  %113 = add i32 %112, 1
  store i32 %113, ptr %111, align 4, !tbaa !18
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.fstWriterContext, ptr %114, i32 0, i32 14
  %116 = load i32, ptr %115, align 4, !tbaa !18
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.fstWriterContext, ptr %117, i32 0, i32 43
  %119 = load i32, ptr %118, align 8, !tbaa !19
  %120 = icmp eq i32 %116, %119
  br i1 %120, label %121, label %175

121:                                              ; preds = %98
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.fstWriterContext, ptr %122, i32 0, i32 40
  %124 = load i64, ptr %123, align 8, !tbaa !20
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.fstWriterContext, ptr %125, i32 0, i32 42
  %127 = load i64, ptr %126, align 8, !tbaa !21
  %128 = icmp ult i64 %124, %127
  br i1 %128, label %129, label %174

129:                                              ; preds = %121
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.fstWriterContext, ptr %130, i32 0, i32 43
  %132 = load i32, ptr %131, align 8, !tbaa !19
  %133 = add i32 %132, 1000000
  store i32 %133, ptr %131, align 8, !tbaa !19
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.fstWriterContext, ptr %134, i32 0, i32 38
  %136 = load i64, ptr %135, align 8, !tbaa !22
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.fstWriterContext, ptr %137, i32 0, i32 40
  %139 = load i64, ptr %138, align 8, !tbaa !20
  %140 = add i64 %139, %136
  store i64 %140, ptr %138, align 8, !tbaa !20
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.fstWriterContext, ptr %141, i32 0, i32 39
  %143 = load i64, ptr %142, align 8, !tbaa !23
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.fstWriterContext, ptr %144, i32 0, i32 41
  %146 = load i64, ptr %145, align 8, !tbaa !24
  %147 = add i64 %146, %143
  store i64 %147, ptr %145, align 8, !tbaa !24
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.fstWriterContext, ptr %148, i32 0, i32 40
  %150 = load i64, ptr %149, align 8, !tbaa !20
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.fstWriterContext, ptr %151, i32 0, i32 41
  %153 = load i64, ptr %152, align 8, !tbaa !24
  %154 = add i64 %150, %153
  %155 = trunc i64 %154 to i32
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.fstWriterContext, ptr %156, i32 0, i32 24
  store i32 %155, ptr %157, align 4, !tbaa !25
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.fstWriterContext, ptr %158, i32 0, i32 6
  %160 = load ptr, ptr %159, align 8, !tbaa !26
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %173

162:                                              ; preds = %129
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.fstWriterContext, ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %164, align 8, !tbaa !26
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.fstWriterContext, ptr %166, i32 0, i32 24
  %168 = load i32, ptr %167, align 4, !tbaa !25
  %169 = zext i32 %168 to i64
  %170 = call ptr @realloc(ptr noundef %165, i64 noundef %169) #7
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.fstWriterContext, ptr %171, i32 0, i32 6
  store ptr %170, ptr %172, align 8, !tbaa !26
  br label %173

173:                                              ; preds = %162, %129
  br label %174

174:                                              ; preds = %173, %121
  br label %175

175:                                              ; preds = %174, %98
  %176 = load i32, ptr %13, align 4, !tbaa !9
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %254, label %178

178:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %194

181:                                              ; preds = %178
  %182 = load ptr, ptr %8, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.fstWriterContext, ptr %182, i32 0, i32 2
  %184 = load ptr, ptr %183, align 8, !tbaa !27
  %185 = load i32, ptr %16, align 4, !tbaa !9
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %189, label %187

187:                                              ; preds = %181
  %188 = load i32, ptr %11, align 4, !tbaa !9
  br label %190

189:                                              ; preds = %181
  br label %190

190:                                              ; preds = %189, %187
  %191 = phi i32 [ %188, %187 ], [ 0, %189 ]
  %192 = zext i32 %191 to i64
  %193 = call i32 @fstWriterVarint(ptr noundef %184, i64 noundef %192)
  br label %199

194:                                              ; preds = %178
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.fstWriterContext, ptr %195, i32 0, i32 2
  %197 = load ptr, ptr %196, align 8, !tbaa !27
  %198 = call i32 @fstWriterVarint(ptr noundef %197, i64 noundef 4294967295)
  br label %199

199:                                              ; preds = %194, %190
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.fstWriterContext, ptr %200, i32 0, i32 15
  %202 = load ptr, ptr %8, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.fstWriterContext, ptr %202, i32 0, i32 3
  %204 = load ptr, ptr %203, align 8, !tbaa !28
  %205 = call i64 @fstFwrite(ptr noundef %201, i64 noundef 4, i64 noundef 1, ptr noundef %204)
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.fstWriterContext, ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !28
  %209 = call i64 @fstFwrite(ptr noundef %11, i64 noundef 4, i64 noundef 1, ptr noundef %208)
  %210 = load ptr, ptr %8, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.fstWriterContext, ptr %210, i32 0, i32 3
  %212 = load ptr, ptr %211, align 8, !tbaa !28
  %213 = call i64 @fstFwrite(ptr noundef %17, i64 noundef 4, i64 noundef 1, ptr noundef %212)
  %214 = load ptr, ptr %8, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.fstWriterContext, ptr %214, i32 0, i32 3
  %216 = load ptr, ptr %215, align 8, !tbaa !28
  %217 = call i64 @fstFwrite(ptr noundef %17, i64 noundef 4, i64 noundef 1, ptr noundef %216)
  %218 = load i32, ptr %16, align 4, !tbaa !9
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %234, label %220

220:                                              ; preds = %199
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %230, %220
  %222 = load i32, ptr %14, align 4, !tbaa !9
  %223 = load i32, ptr %11, align 4, !tbaa !9
  %224 = icmp ult i32 %222, %223
  br i1 %224, label %225, label %233

225:                                              ; preds = %221
  %226 = load ptr, ptr %8, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.fstWriterContext, ptr %226, i32 0, i32 4
  %228 = load ptr, ptr %227, align 8, !tbaa !29
  %229 = call i32 @fputc(i32 noundef 120, ptr noundef %228)
  br label %230

230:                                              ; preds = %225
  %231 = load i32, ptr %14, align 4, !tbaa !9
  %232 = add i32 %231, 1
  store i32 %232, ptr %14, align 4, !tbaa !9
  br label %221, !llvm.loop !30

233:                                              ; preds = %221
  br label %241

234:                                              ; preds = %199
  %235 = load ptr, ptr %8, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.fstWriterContext, ptr %235, i32 0, i32 28
  %237 = load ptr, ptr %8, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.fstWriterContext, ptr %237, i32 0, i32 4
  %239 = load ptr, ptr %238, align 8, !tbaa !29
  %240 = call i64 @fstFwrite(ptr noundef %236, i64 noundef 8, i64 noundef 1, ptr noundef %239)
  br label %241

241:                                              ; preds = %234, %233
  %242 = load i32, ptr %11, align 4, !tbaa !9
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.fstWriterContext, ptr %243, i32 0, i32 15
  %245 = load i32, ptr %244, align 8, !tbaa !32
  %246 = add i32 %245, %242
  store i32 %246, ptr %244, align 8, !tbaa !32
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.fstWriterContext, ptr %247, i32 0, i32 13
  %249 = load i32, ptr %248, align 8, !tbaa !17
  %250 = add i32 %249, 1
  store i32 %250, ptr %248, align 8, !tbaa !17
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.fstWriterContext, ptr %251, i32 0, i32 13
  %253 = load i32, ptr %252, align 8, !tbaa !17
  store i32 %253, ptr %7, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %257

254:                                              ; preds = %175
  %255 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %255, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %257

256:                                              ; preds = %21, %6
  store i32 0, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %257

257:                                              ; preds = %256, %254, %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %258 = load i32, ptr %7, align 4
  ret i32 %258
}

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 64}
!12 = !{!"fstWriterContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, 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, !13, i64 120, !13, i64 128, !10, i64 136, !10, i64 140, !13, i64 144, !13, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !13, i64 176, !10, i64 184, !14, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !13, 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, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !13, 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}
!13 = !{!"long", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!12, !6, i64 8}
!16 = !{!12, !13, i64 56}
!17 = !{!12, !10, i64 104}
!18 = !{!12, !10, i64 108}
!19 = !{!12, !10, i64 280}
!20 = !{!12, !13, i64 256}
!21 = !{!12, !13, i64 272}
!22 = !{!12, !13, i64 240}
!23 = !{!12, !13, i64 248}
!24 = !{!12, !13, i64 264}
!25 = !{!12, !10, i64 164}
!26 = !{!12, !6, i64 48}
!27 = !{!12, !6, i64 16}
!28 = !{!12, !6, i64 24}
!29 = !{!12, !6, i64 32}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!12, !10, i64 112}


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

; 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 memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @fstDestroyMmaps(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i64 @fstFwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @fstWriterVarint(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @fstWriterCreateVar(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #2 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 %3, ptr %7, align 4, !tbaa !5
  %9 = icmp ne ptr %0, null
  %10 = icmp ne ptr %4, null
  %or.cond = and i1 %9, %10
  br i1 %or.cond, label %11, label %117

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %15, label %14

14:                                               ; preds = %11
  tail call void @fstDestroyMmaps(ptr noundef nonnull %0, i32 noundef 0)
  br label %15

15:                                               ; preds = %14, %11
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = tail call i32 @fputc(i32 noundef %1, ptr noundef %17)
  %19 = load ptr, ptr %16, align 8, !tbaa !14
  %20 = tail call i32 @fputc(i32 noundef %2, ptr noundef %19)
  %21 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #5
  %sext = shl i64 %21, 32
  %22 = ashr exact i64 %sext, 32
  %23 = load ptr, ptr %16, align 8, !tbaa !14
  %24 = tail call i64 @fstFwrite(ptr noundef nonnull %4, i64 noundef %22, i64 noundef 1, ptr noundef %23)
  %25 = load ptr, ptr %16, align 8, !tbaa !14
  %26 = tail call i32 @fputc(i32 noundef 0, ptr noundef %25)
  %sext78 = add i64 %sext, 12884901888
  %27 = ashr exact i64 %sext78, 32
  %28 = getelementptr inbounds i8, ptr %0, i64 56
  %29 = load i64, ptr %28, align 8, !tbaa !15
  %30 = add nsw i64 %29, %27
  store i64 %30, ptr %28, align 8, !tbaa !15
  %31 = add i32 %1, -5
  %or.cond3 = icmp ult i32 %31, -2
  %32 = icmp ne i32 %1, 20
  %or.cond5.not85 = and i1 %32, %or.cond3
  %33 = icmp ne i32 %1, 29
  %or.cond7.not = and i1 %33, %or.cond5.not85
  switch i32 %1, label %36 [
    i32 29, label %34
    i32 20, label %34
    i32 4, label %34
    i32 3, label %34
    i32 21, label %35
  ]

34:                                               ; preds = %15, %15, %15, %15
  store i32 8, ptr %7, align 4, !tbaa !5
  br label %36

35:                                               ; preds = %15
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %15, %35, %34
  %37 = phi i32 [ %3, %15 ], [ 0, %35 ], [ 8, %34 ]
  %38 = load ptr, ptr %16, align 8, !tbaa !14
  %39 = zext i32 %37 to i64
  %40 = tail call i32 @fstWriterVarint(ptr noundef %38, i64 noundef %39)
  %41 = sext i32 %40 to i64
  %42 = load i64, ptr %28, align 8, !tbaa !15
  %43 = add nsw i64 %42, %41
  store i64 %43, ptr %28, align 8, !tbaa !15
  %44 = getelementptr inbounds i8, ptr %0, i64 104
  %45 = load i32, ptr %44, align 8, !tbaa !16
  %46 = icmp ult i32 %45, %5
  %spec.store.select = select i1 %46, i32 0, i32 %5
  %47 = load ptr, ptr %16, align 8, !tbaa !14
  %48 = zext i32 %spec.store.select to i64
  %49 = tail call i32 @fstWriterVarint(ptr noundef %47, i64 noundef %48)
  %50 = sext i32 %49 to i64
  %51 = load i64, ptr %28, align 8, !tbaa !15
  %52 = add nsw i64 %51, %50
  store i64 %52, ptr %28, align 8, !tbaa !15
  %53 = getelementptr inbounds i8, ptr %0, i64 108
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = add i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !17
  %56 = getelementptr inbounds i8, ptr %0, i64 280
  %57 = load i32, ptr %56, align 8, !tbaa !18
  %58 = icmp eq i32 %55, %57
  br i1 %58, label %59, label %83

59:                                               ; preds = %36
  %60 = getelementptr inbounds i8, ptr %0, i64 256
  %61 = load i64, ptr %60, align 8, !tbaa !19
  %62 = getelementptr inbounds i8, ptr %0, i64 272
  %63 = load i64, ptr %62, align 8, !tbaa !20
  %64 = icmp ult i64 %61, %63
  br i1 %64, label %65, label %83

65:                                               ; preds = %59
  %66 = add i32 %54, 1000001
  store i32 %66, ptr %56, align 8, !tbaa !18
  %67 = getelementptr inbounds i8, ptr %0, i64 240
  %68 = load i64, ptr %67, align 8, !tbaa !21
  %69 = add i64 %68, %61
  store i64 %69, ptr %60, align 8, !tbaa !19
  %70 = getelementptr inbounds i8, ptr %0, i64 248
  %71 = load i64, ptr %70, align 8, !tbaa !22
  %72 = getelementptr inbounds i8, ptr %0, i64 264
  %73 = load i64, ptr %72, align 8, !tbaa !23
  %74 = add i64 %73, %71
  store i64 %74, ptr %72, align 8, !tbaa !23
  %75 = add i64 %74, %69
  %76 = trunc i64 %75 to i32
  %77 = getelementptr inbounds i8, ptr %0, i64 164
  store i32 %76, ptr %77, align 4, !tbaa !24
  %78 = getelementptr inbounds i8, ptr %0, i64 48
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %.not79 = icmp eq ptr %79, null
  br i1 %.not79, label %83, label %80

80:                                               ; preds = %65
  %81 = and i64 %75, 4294967295
  %82 = tail call ptr @realloc(ptr noundef nonnull %79, i64 noundef %81) #6
  store ptr %82, ptr %78, align 8, !tbaa !25
  br label %83

83:                                               ; preds = %59, %80, %65, %36
  %.not80 = icmp eq i32 %spec.store.select, 0
  br i1 %.not80, label %84, label %117

84:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  %.not81 = icmp eq i32 %37, 0
  %85 = getelementptr inbounds i8, ptr %0, i64 16
  %86 = load ptr, ptr %85, align 8, !tbaa !26
  %87 = select i1 %or.cond7.not, i64 %39, i64 0
  %.sink = select i1 %.not81, i64 4294967295, i64 %87
  %88 = tail call i32 @fstWriterVarint(ptr noundef %86, i64 noundef %.sink)
  %89 = getelementptr inbounds i8, ptr %0, i64 112
  %90 = getelementptr inbounds i8, ptr %0, i64 24
  %91 = load ptr, ptr %90, align 8, !tbaa !27
  %92 = tail call i64 @fstFwrite(ptr noundef nonnull %89, i64 noundef 4, i64 noundef 1, ptr noundef %91)
  %93 = load ptr, ptr %90, align 8, !tbaa !27
  %94 = call i64 @fstFwrite(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef %93)
  %95 = load ptr, ptr %90, align 8, !tbaa !27
  %96 = call i64 @fstFwrite(ptr noundef nonnull %8, i64 noundef 4, i64 noundef 1, ptr noundef %95)
  %97 = load ptr, ptr %90, align 8, !tbaa !27
  %98 = call i64 @fstFwrite(ptr noundef nonnull %8, i64 noundef 4, i64 noundef 1, ptr noundef %97)
  switch i32 %1, label %.preheader [
    i32 29, label %107
    i32 20, label %107
    i32 4, label %107
    i32 3, label %107
  ]

.preheader:                                       ; preds = %84
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %.not88 = icmp eq i32 %99, 0
  br i1 %.not88, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %100 = getelementptr inbounds i8, ptr %0, i64 32
  br label %101

101:                                              ; preds = %.lr.ph, %101
  %.07187 = phi i32 [ 0, %.lr.ph ], [ %104, %101 ]
  %102 = load ptr, ptr %100, align 8, !tbaa !28
  %103 = call i32 @fputc(i32 noundef 120, ptr noundef %102)
  %104 = add nuw i32 %.07187, 1
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = icmp ult i32 %104, %105
  br i1 %106, label %101, label %.loopexit, !llvm.loop !29

107:                                              ; preds = %84, %84, %84, %84
  %108 = getelementptr inbounds i8, ptr %0, i64 192
  %109 = getelementptr inbounds i8, ptr %0, i64 32
  %110 = load ptr, ptr %109, align 8, !tbaa !28
  %111 = call i64 @fstFwrite(ptr noundef nonnull %108, i64 noundef 8, i64 noundef 1, ptr noundef %110)
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %101, %.preheader, %107
  %112 = phi i32 [ 0, %.preheader ], [ %.pre, %107 ], [ %105, %101 ]
  %113 = load i32, ptr %89, align 8, !tbaa !31
  %114 = add i32 %113, %112
  store i32 %114, ptr %89, align 8, !tbaa !31
  %115 = load i32, ptr %44, align 8, !tbaa !16
  %116 = add i32 %115, 1
  store i32 %116, ptr %44, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %117

117:                                              ; preds = %6, %83, %.loopexit
  %.070 = phi i32 [ %116, %.loopexit ], [ %5, %83 ], [ 0, %6 ]
  ret i32 %.070
}

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #5 = { nounwind willreturn memory(read) }
attributes #6 = { nounwind allocsize(1) }
attributes #7 = { 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, !11, i64 64}
!10 = !{!"fstWriterContext", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !6, i64 88, !11, i64 96, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 116, !6, i64 116, !6, i64 116, !12, i64 120, !12, i64 128, !6, i64 136, !6, i64 140, !12, i64 144, !12, i64 152, !6, i64 160, !6, i64 164, !6, i64 168, !12, i64 176, !6, i64 184, !13, i64 192, !11, i64 200, !11, i64 208, !6, i64 216, !12, i64 224, !7, i64 232, !6, i64 233, !6, i64 233, !6, i64 233, !6, i64 233, !6, i64 233, !6, i64 233, !6, i64 233, !6, i64 233, !7, i64 234, !7, i64 235, !6, i64 236, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !6, i64 300, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !6, i64 336}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !12, i64 56}
!16 = !{!10, !6, i64 104}
!17 = !{!10, !6, i64 108}
!18 = !{!10, !6, i64 280}
!19 = !{!10, !12, i64 256}
!20 = !{!10, !12, i64 272}
!21 = !{!10, !12, i64 240}
!22 = !{!10, !12, i64 248}
!23 = !{!10, !12, i64 264}
!24 = !{!10, !6, i64 164}
!25 = !{!10, !11, i64 48}
!26 = !{!10, !11, i64 16}
!27 = !{!10, !11, i64 24}
!28 = !{!10, !11, i64 32}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!10, !6, i64 112}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass