; 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 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @fstWriterCreate(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %8 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 344) #9
  store ptr %8, ptr %5, align 8, !tbaa !5
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.fstWriterContext, ptr %10, i32 0, i32 34
  %12 = trunc i32 %9 to i8
  %13 = load i8, ptr %11, align 1
  %14 = and i8 %12, 1
  %15 = and i8 %13, -2
  %16 = or i8 %15, %14
  store i8 %16, ptr %11, align 1
  %17 = zext i8 %14 to i32
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  call void @fstDetermineBreakSize(ptr noundef %18)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %27

21:                                               ; preds = %2
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call ptr @unlink_fopen(ptr noundef %22, ptr noundef @.str)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.fstWriterContext, ptr %24, i32 0, i32 0
  store ptr %23, ptr %25, align 8, !tbaa !11
  %26 = icmp ne ptr %23, null
  br i1 %26, label %29, label %27

27:                                               ; preds = %21, %2
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %28) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  br label %169

29:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call i64 @strlen(ptr noundef %30) #10
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = add nsw i32 %33, 6
  %35 = sext i32 %34 to i64
  %36 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %35) #9
  store ptr %36, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %37, ptr align 1 %38, i64 %40, i1 false)
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = call ptr @strcpy(ptr noundef %44, ptr noundef @.str.1) #8
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = call ptr @unlink_fopen(ptr noundef %46, ptr noundef @.str)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.fstWriterContext, ptr %48, i32 0, i32 1
  store ptr %47, ptr %49, align 8, !tbaa !15
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.fstWriterContext, ptr %50, i32 0, i32 47
  %52 = call ptr @tmpfile_open(ptr noundef %51)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.fstWriterContext, ptr %53, i32 0, i32 2
  store ptr %52, ptr %54, align 8, !tbaa !16
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.fstWriterContext, ptr %55, i32 0, i32 48
  %57 = call ptr @tmpfile_open(ptr noundef %56)
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.fstWriterContext, ptr %58, i32 0, i32 3
  store ptr %57, ptr %59, align 8, !tbaa !17
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.fstWriterContext, ptr %60, i32 0, i32 49
  %62 = call ptr @tmpfile_open(ptr noundef %61)
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.fstWriterContext, ptr %63, i32 0, i32 4
  store ptr %62, ptr %64, align 8, !tbaa !18
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.fstWriterContext, ptr %65, i32 0, i32 50
  %67 = call ptr @tmpfile_open(ptr noundef %66)
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.fstWriterContext, ptr %68, i32 0, i32 5
  store ptr %67, ptr %69, align 8, !tbaa !19
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.fstWriterContext, ptr %70, i32 0, i32 40
  %72 = load i64, ptr %71, align 8, !tbaa !20
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.fstWriterContext, ptr %73, i32 0, i32 41
  %75 = load i64, ptr %74, align 8, !tbaa !21
  %76 = add i64 %72, %75
  %77 = trunc i64 %76 to i32
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.fstWriterContext, ptr %78, i32 0, i32 24
  store i32 %77, ptr %79, align 4, !tbaa !22
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.fstWriterContext, ptr %80, i32 0, i32 24
  %82 = load i32, ptr %81, align 4, !tbaa !22
  %83 = zext i32 %82 to i64
  %84 = call noalias ptr @malloc(i64 noundef %83) #11
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.fstWriterContext, ptr %85, i32 0, i32 6
  store ptr %84, ptr %86, align 8, !tbaa !23
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.fstWriterContext, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %130

91:                                               ; preds = %29
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.fstWriterContext, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !16
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %130

96:                                               ; preds = %91
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.fstWriterContext, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !17
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %130

101:                                              ; preds = %96
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.fstWriterContext, ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !18
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %130

106:                                              ; preds = %101
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.fstWriterContext, ptr %107, i32 0, i32 6
  %109 = load ptr, ptr %108, align 8, !tbaa !23
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %130

111:                                              ; preds = %106
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.fstWriterContext, ptr %112, i32 0, i32 5
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %130

116:                                              ; preds = %111
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = call noalias ptr @strdup(ptr noundef %117) #8
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.fstWriterContext, ptr %119, i32 0, i32 12
  store ptr %118, ptr %120, align 8, !tbaa !24
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.fstWriterContext, ptr %121, i32 0, i32 16
  %123 = load i8, ptr %122, align 4
  %124 = and i8 %123, -3
  %125 = or i8 %124, 2
  store i8 %125, ptr %122, align 4
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  call void @fstWriterEmitHdrBytes(ptr noundef %126)
  %127 = call double @strtod(ptr noundef @.str.2, ptr noundef null) #8
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.fstWriterContext, ptr %128, i32 0, i32 28
  store double %127, ptr %129, align 8, !tbaa !25
  br label %167

130:                                              ; preds = %111, %106, %101, %96, %91, %29
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.fstWriterContext, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = call i32 @fclose(ptr noundef %133)
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.fstWriterContext, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %146

139:                                              ; preds = %130
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.fstWriterContext, ptr %140, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !15
  %143 = call i32 @fclose(ptr noundef %142)
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = call i32 @unlink(ptr noundef %144) #8
  br label %146

146:                                              ; preds = %139, %130
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.fstWriterContext, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.fstWriterContext, ptr %149, i32 0, i32 47
  call void @tmpfile_close(ptr noundef %148, ptr noundef %150)
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.fstWriterContext, ptr %151, i32 0, i32 3
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.fstWriterContext, ptr %153, i32 0, i32 48
  call void @tmpfile_close(ptr noundef %152, ptr noundef %154)
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.fstWriterContext, ptr %155, i32 0, i32 4
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.fstWriterContext, ptr %157, i32 0, i32 49
  call void @tmpfile_close(ptr noundef %156, ptr noundef %158)
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.fstWriterContext, ptr %159, i32 0, i32 5
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.fstWriterContext, ptr %161, i32 0, i32 50
  call void @tmpfile_close(ptr noundef %160, ptr noundef %162)
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.fstWriterContext, ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %164, align 8, !tbaa !23
  call void @free(ptr noundef %165) #8
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %166) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %146, %116
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %168) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %169

169:                                              ; preds = %167, %27
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret ptr %170
}

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

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

; Function Attrs: nounwind uwtable
declare hidden void @fstDetermineBreakSize(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @unlink_fopen(ptr noundef, ptr noundef) #0

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

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

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @tmpfile_open(ptr noundef) #0

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

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @fstWriterEmitHdrBytes(ptr noundef) #0

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #3

declare i32 @fclose(ptr noundef) #7

; Function Attrs: nounwind
declare i32 @unlink(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @tmpfile_close(ptr noundef, ptr noundef) #0

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { "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 allocsize(0,1) }
attributes #10 = { nounwind willreturn memory(read) }
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 = !{!12, !6, i64 0}
!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, !6, i64 16}
!17 = !{!12, !6, i64 24}
!18 = !{!12, !6, i64 32}
!19 = !{!12, !6, i64 40}
!20 = !{!12, !13, i64 256}
!21 = !{!12, !13, i64 264}
!22 = !{!12, !10, i64 164}
!23 = !{!12, !6, i64 48}
!24 = !{!12, !6, i64 96}
!25 = !{!12, !14, i64 192}


; 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 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @fstWriterCreate(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = tail call noalias dereferenceable_or_null(344) ptr @calloc(i64 noundef 1, i64 noundef 344) #10
  %4 = getelementptr inbounds i8, ptr %3, i64 233
  %5 = trunc i32 %1 to i8
  %6 = and i8 %5, 1
  store i8 %6, ptr %4, align 1
  tail call void @fstDetermineBreakSize(ptr noundef %3)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %9, label %7

7:                                                ; preds = %2
  %8 = tail call ptr @unlink_fopen(ptr noundef nonnull %0, ptr noundef nonnull @.str)
  store ptr %8, ptr %3, align 8, !tbaa !5
  %.not57 = icmp eq ptr %8, null
  br i1 %.not57, label %9, label %10

9:                                                ; preds = %7, %2
  tail call void @free(ptr noundef nonnull %3) #11
  br label %67

10:                                               ; preds = %7
  %11 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #12
  %12 = shl i64 %11, 32
  %sext = add i64 %12, 25769803776
  %13 = ashr exact i64 %sext, 32
  %14 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %13) #10
  %15 = ashr exact i64 %12, 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr nonnull align 1 %0, i64 %15, i1 false)
  %16 = getelementptr inbounds i8, ptr %14, i64 %15
  %17 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.1) #11
  %18 = tail call ptr @unlink_fopen(ptr noundef %14, ptr noundef nonnull @.str)
  %19 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %18, ptr %19, align 8, !tbaa !13
  %20 = getelementptr inbounds i8, ptr %3, i64 304
  %21 = tail call ptr @tmpfile_open(ptr noundef nonnull %20)
  %22 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %21, ptr %22, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %3, i64 312
  %24 = tail call ptr @tmpfile_open(ptr noundef nonnull %23)
  %25 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %24, ptr %25, align 8, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %3, i64 320
  %27 = tail call ptr @tmpfile_open(ptr noundef nonnull %26)
  %28 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr %27, ptr %28, align 8, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %3, i64 328
  %30 = tail call ptr @tmpfile_open(ptr noundef nonnull %29)
  %31 = getelementptr inbounds i8, ptr %3, i64 40
  store ptr %30, ptr %31, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %3, i64 256
  %33 = load i64, ptr %32, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %3, i64 264
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = add i64 %35, %33
  %37 = trunc i64 %36 to i32
  %38 = getelementptr inbounds i8, ptr %3, i64 164
  store i32 %37, ptr %38, align 4, !tbaa !20
  %39 = and i64 %36, 4294967295
  %40 = tail call noalias ptr @malloc(i64 noundef %39) #13
  %41 = getelementptr inbounds i8, ptr %3, i64 48
  store ptr %40, ptr %41, align 8, !tbaa !21
  %42 = load ptr, ptr %19, align 8, !tbaa !13
  %.not59 = icmp eq ptr %42, null
  br i1 %.not59, label %57, label %43

43:                                               ; preds = %10
  %44 = load ptr, ptr %22, align 8, !tbaa !14
  %.not60 = icmp eq ptr %44, null
  br i1 %.not60, label %57, label %45

45:                                               ; preds = %43
  %46 = load ptr, ptr %25, align 8, !tbaa !15
  %.not61 = icmp eq ptr %46, null
  br i1 %.not61, label %57, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr %28, align 8, !tbaa !16
  %.not62 = icmp eq ptr %48, null
  %.not63 = icmp eq ptr %40, null
  %or.cond = or i1 %.not63, %.not62
  %.not64 = icmp eq ptr %30, null
  %or.cond66 = select i1 %or.cond, i1 true, i1 %.not64
  br i1 %or.cond66, label %57, label %49

49:                                               ; preds = %47
  %50 = tail call noalias ptr @strdup(ptr noundef nonnull %0) #11
  %51 = getelementptr inbounds i8, ptr %3, i64 96
  store ptr %50, ptr %51, align 8, !tbaa !22
  %52 = getelementptr inbounds i8, ptr %3, i64 116
  %53 = load i8, ptr %52, align 4
  %54 = or i8 %53, 2
  store i8 %54, ptr %52, align 4
  tail call void @fstWriterEmitHdrBytes(ptr noundef nonnull %3)
  %55 = tail call double @strtod(ptr nocapture noundef nonnull @.str.2, ptr noundef null) #11
  %56 = getelementptr inbounds i8, ptr %3, i64 192
  store double %55, ptr %56, align 8, !tbaa !23
  br label %66

57:                                               ; preds = %47, %45, %43, %10
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = tail call i32 @fclose(ptr noundef %58)
  %60 = load ptr, ptr %19, align 8, !tbaa !13
  %.not65 = icmp eq ptr %60, null
  br i1 %.not65, label %64, label %61

61:                                               ; preds = %57
  %62 = tail call i32 @fclose(ptr noundef nonnull %60)
  %63 = tail call i32 @unlink(ptr noundef %14) #11
  br label %64

64:                                               ; preds = %61, %57
  tail call void @tmpfile_close(ptr noundef nonnull %22, ptr noundef nonnull %20)
  tail call void @tmpfile_close(ptr noundef nonnull %25, ptr noundef nonnull %23)
  tail call void @tmpfile_close(ptr noundef nonnull %28, ptr noundef nonnull %26)
  tail call void @tmpfile_close(ptr noundef nonnull %31, ptr noundef nonnull %29)
  %65 = load ptr, ptr %41, align 8, !tbaa !21
  tail call void @free(ptr noundef %65) #11
  tail call void @free(ptr noundef nonnull %3) #11
  br label %66

66:                                               ; preds = %64, %49
  %.0 = phi ptr [ %3, %49 ], [ null, %64 ]
  tail call void @free(ptr noundef %14) #11
  br label %67

67:                                               ; preds = %66, %9
  %.1 = phi ptr [ %.0, %66 ], [ null, %9 ]
  ret ptr %.1
}

; 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: nounwind uwtable
declare hidden void @fstDetermineBreakSize(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @unlink_fopen(ptr noundef, ptr noundef) local_unnamed_addr #0

; 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 memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden ptr @tmpfile_open(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare hidden void @fstWriterEmitHdrBytes(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #8

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

; Function Attrs: nofree nounwind
declare noundef i32 @unlink(ptr nocapture noundef readonly) local_unnamed_addr #9

; Function Attrs: nounwind uwtable
declare hidden void @tmpfile_close(ptr noundef, ptr noundef) local_unnamed_addr #0

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 = { 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 memory(argmem: readwrite) "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 = { 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 #7 = { mustprogress nofree nounwind willreturn 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 #8 = { mustprogress nofree nounwind willreturn "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 = { 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 #10 = { nounwind allocsize(0,1) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
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, !7, i64 0}
!6 = !{!"fstWriterContext", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !11, i64 88, !7, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 116, !11, i64 116, !11, i64 116, !10, i64 120, !10, i64 128, !11, i64 136, !11, i64 140, !10, i64 144, !10, i64 152, !11, i64 160, !11, i64 164, !11, i64 168, !10, i64 176, !11, i64 184, !12, i64 192, !7, i64 200, !7, i64 208, !11, i64 216, !10, i64 224, !8, i64 232, !11, i64 233, !11, i64 233, !11, i64 233, !11, i64 233, !11, i64 233, !11, i64 233, !11, i64 233, !11, i64 233, !8, i64 234, !8, i64 235, !11, i64 236, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !11, i64 280, !7, i64 288, !11, i64 296, !11, i64 300, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !11, i64 336}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 16}
!15 = !{!6, !7, i64 24}
!16 = !{!6, !7, i64 32}
!17 = !{!6, !7, i64 40}
!18 = !{!6, !10, i64 256}
!19 = !{!6, !10, i64 264}
!20 = !{!6, !11, i64 164}
!21 = !{!6, !7, i64 48}
!22 = !{!6, !7, i64 96}
!23 = !{!6, !12, i64 192}


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