; LLVM IR from ryanlayer/giggle :: src (disk_store)

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

@.str = external hidden unnamed_addr constant [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

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

17:                                               ; preds = %5
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str) #8
  unreachable

18:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 122, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 6, ptr %13, align 1, !tbaa !11
  %19 = load i8, ptr %12, align 1, !tbaa !11
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %29

21:                                               ; preds = %18
  %22 = load ptr, ptr %11, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.disk_store, ptr %22, i32 0, i32 10
  store i8 1, ptr %23, align 8, !tbaa !12
  %24 = load i8, ptr %12, align 1, !tbaa !11
  %25 = load i8, ptr %13, align 1, !tbaa !11
  %26 = call ptr @new_disk_file_header(i8 noundef zeroext %24, i8 noundef zeroext %25)
  %27 = load ptr, ptr %11, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.disk_store, ptr %27, i32 0, i32 11
  store ptr %26, ptr %28, align 8, !tbaa !15
  br label %34

29:                                               ; preds = %18
  %30 = load ptr, ptr %11, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.disk_store, ptr %30, i32 0, i32 10
  store i8 0, ptr %31, align 8, !tbaa !12
  %32 = load ptr, ptr %11, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.disk_store, ptr %32, i32 0, i32 11
  store ptr null, ptr %33, align 8, !tbaa !15
  br label %34

34:                                               ; preds = %29, %21
  %35 = load ptr, ptr %11, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.disk_store, ptr %35, i32 0, i32 5
  store i32 0, ptr %36, align 4, !tbaa !16
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load ptr, ptr %11, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.disk_store, ptr %38, i32 0, i32 4
  store i32 %37, ptr %39, align 8, !tbaa !17
  %40 = load ptr, ptr %8, align 8, !tbaa !9
  %41 = call noalias ptr @strdup(ptr noundef %40) #6
  %42 = load ptr, ptr %11, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.disk_store, ptr %42, i32 0, i32 0
  store ptr %41, ptr %43, align 8, !tbaa !18
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = call noalias ptr @strdup(ptr noundef %44) #6
  %46 = load ptr, ptr %11, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.disk_store, ptr %46, i32 0, i32 1
  store ptr %45, ptr %47, align 8, !tbaa !19
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = call noalias ptr @calloc(i64 noundef %49, i64 noundef 8) #7
  %51 = load ptr, ptr %11, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.disk_store, ptr %51, i32 0, i32 8
  store ptr %50, ptr %52, align 8, !tbaa !20
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.disk_store, ptr %53, i32 0, i32 8
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %58

57:                                               ; preds = %34
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str) #8
  unreachable

58:                                               ; preds = %34
  %59 = load ptr, ptr %11, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.disk_store, ptr %59, i32 0, i32 10
  %61 = load i8, ptr %60, align 8, !tbaa !12
  %62 = icmp ne i8 %61, 0
  br i1 %62, label %63, label %75

63:                                               ; preds = %58
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = zext i32 %64 to i64
  %66 = call noalias ptr @calloc(i64 noundef %65, i64 noundef 4) #7
  %67 = load ptr, ptr %11, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.disk_store, ptr %67, i32 0, i32 9
  store ptr %66, ptr %68, align 8, !tbaa !21
  %69 = load ptr, ptr %11, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.disk_store, ptr %69, i32 0, i32 9
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %74

73:                                               ; preds = %63
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str) #8
  unreachable

74:                                               ; preds = %63
  br label %78

75:                                               ; preds = %58
  %76 = load ptr, ptr %11, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.disk_store, ptr %76, i32 0, i32 9
  store ptr null, ptr %77, align 8, !tbaa !21
  br label %78

78:                                               ; preds = %75, %74
  %79 = load ptr, ptr %7, align 8, !tbaa !9
  %80 = icmp eq ptr %79, null
  br i1 %80, label %85, label %81

81:                                               ; preds = %78
  %82 = load ptr, ptr %7, align 8, !tbaa !9
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %97

85:                                               ; preds = %81, %78
  %86 = load ptr, ptr %8, align 8, !tbaa !9
  %87 = call noalias ptr @fopen(ptr noundef %86, ptr noundef @.str.1)
  %88 = load ptr, ptr %11, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.disk_store, ptr %88, i32 0, i32 2
  store ptr %87, ptr %89, align 8, !tbaa !22
  %90 = load ptr, ptr %11, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.disk_store, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  %93 = icmp eq ptr %92, null
  br i1 %93, label %94, label %96

94:                                               ; preds = %85
  %95 = load ptr, ptr %8, align 8, !tbaa !9
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.2, ptr noundef %95) #8
  unreachable

96:                                               ; preds = %85
  br label %102

97:                                               ; preds = %81
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = load ptr, ptr %11, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.disk_store, ptr %100, i32 0, i32 2
  store ptr %99, ptr %101, align 8, !tbaa !22
  br label %102

102:                                              ; preds = %97, %96
  %103 = load ptr, ptr %11, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.disk_store, ptr %103, i32 0, i32 10
  %105 = load i8, ptr %104, align 8, !tbaa !12
  %106 = icmp ne i8 %105, 0
  br i1 %106, label %107, label %117

107:                                              ; preds = %102
  %108 = load ptr, ptr %11, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.disk_store, ptr %108, i32 0, i32 11
  %110 = load ptr, ptr %109, align 8, !tbaa !15
  %111 = load ptr, ptr %11, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.disk_store, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !22
  %114 = load ptr, ptr %11, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.disk_store, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  call void @write_disk_file_header(ptr noundef @.str.3, ptr noundef %110, ptr noundef %113, ptr noundef %116)
  br label %117

117:                                              ; preds = %107, %102
  %118 = load ptr, ptr %11, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.disk_store, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !22
  %121 = call i64 @ftell(ptr noundef %120)
  %122 = load ptr, ptr %11, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.disk_store, ptr %122, i32 0, i32 6
  store i64 %121, ptr %123, align 8, !tbaa !23
  %124 = load ptr, ptr %11, align 8, !tbaa !9
  %125 = getelementptr inbounds %struct.disk_store, ptr %124, i32 0, i32 4
  %126 = load ptr, ptr %11, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.disk_store, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !22
  %129 = call i64 @fwrite(ptr noundef %125, i64 noundef 4, i64 noundef 1, ptr noundef %128)
  %130 = icmp ne i64 %129, 1
  br i1 %130, label %131, label %135

131:                                              ; preds = %117
  %132 = load ptr, ptr %11, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.disk_store, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !18
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.4, ptr noundef %134) #8
  unreachable

135:                                              ; preds = %117
  %136 = load ptr, ptr %11, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.disk_store, ptr %136, i32 0, i32 5
  %138 = load ptr, ptr %11, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct.disk_store, ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !22
  %141 = call i64 @fwrite(ptr noundef %137, i64 noundef 4, i64 noundef 1, ptr noundef %140)
  %142 = icmp ne i64 %141, 1
  br i1 %142, label %143, label %147

143:                                              ; preds = %135
  %144 = load ptr, ptr %11, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.disk_store, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !18
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.5, ptr noundef %146) #8
  unreachable

147:                                              ; preds = %135
  %148 = load ptr, ptr %9, align 8, !tbaa !9
  %149 = icmp eq ptr %148, null
  br i1 %149, label %154, label %150

150:                                              ; preds = %147
  %151 = load ptr, ptr %9, align 8, !tbaa !9
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = icmp eq ptr %152, null
  br i1 %153, label %154, label %166

154:                                              ; preds = %150, %147
  %155 = load ptr, ptr %10, align 8, !tbaa !9
  %156 = call noalias ptr @fopen(ptr noundef %155, ptr noundef @.str.1)
  %157 = load ptr, ptr %11, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct.disk_store, ptr %157, i32 0, i32 3
  store ptr %156, ptr %158, align 8, !tbaa !24
  %159 = load ptr, ptr %11, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.disk_store, ptr %159, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !24
  %162 = icmp eq ptr %161, null
  br i1 %162, label %163, label %165

163:                                              ; preds = %154
  %164 = load ptr, ptr %10, align 8, !tbaa !9
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.6, ptr noundef %164) #8
  unreachable

165:                                              ; preds = %154
  br label %171

166:                                              ; preds = %150
  %167 = load ptr, ptr %9, align 8, !tbaa !9
  %168 = load ptr, ptr %167, align 8, !tbaa !9
  %169 = load ptr, ptr %11, align 8, !tbaa !9
  %170 = getelementptr inbounds %struct.disk_store, ptr %169, i32 0, i32 3
  store ptr %168, ptr %170, align 8, !tbaa !24
  br label %171

171:                                              ; preds = %166, %165
  %172 = load ptr, ptr %11, align 8, !tbaa !9
  %173 = getelementptr inbounds %struct.disk_store, ptr %172, i32 0, i32 10
  %174 = load i8, ptr %173, align 8, !tbaa !12
  %175 = icmp ne i8 %174, 0
  br i1 %175, label %176, label %186

176:                                              ; preds = %171
  %177 = load ptr, ptr %11, align 8, !tbaa !9
  %178 = getelementptr inbounds %struct.disk_store, ptr %177, i32 0, i32 11
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = load ptr, ptr %11, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.disk_store, ptr %180, i32 0, i32 3
  %182 = load ptr, ptr %181, align 8, !tbaa !24
  %183 = load ptr, ptr %11, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.disk_store, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !19
  call void @write_disk_file_header(ptr noundef @.str.7, ptr noundef %179, ptr noundef %182, ptr noundef %185)
  br label %186

186:                                              ; preds = %176, %171
  %187 = load ptr, ptr %11, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.disk_store, ptr %187, i32 0, i32 3
  %189 = load ptr, ptr %188, align 8, !tbaa !24
  %190 = call i64 @ftell(ptr noundef %189)
  %191 = load ptr, ptr %11, align 8, !tbaa !9
  %192 = getelementptr inbounds %struct.disk_store, ptr %191, i32 0, i32 7
  store i64 %190, ptr %192, align 8, !tbaa !25
  %193 = load ptr, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret ptr %193
}

; 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: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #3

declare ptr @new_disk_file_header(i8 noundef zeroext, i8 noundef zeroext) #4

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare void @write_disk_file_header(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i64 @ftell(ptr noundef) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; 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 = { noreturn "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 = { "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 "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 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 72}
!13 = !{!"disk_store", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 36, !14, i64 40, !14, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !10, i64 80}
!14 = !{!"long", !7, i64 0}
!15 = !{!13, !10, i64 80}
!16 = !{!13, !6, i64 36}
!17 = !{!13, !6, i64 32}
!18 = !{!13, !10, i64 0}
!19 = !{!13, !10, i64 8}
!20 = !{!13, !10, i64 56}
!21 = !{!13, !10, i64 64}
!22 = !{!13, !10, i64 16}
!23 = !{!13, !14, i64 40}
!24 = !{!13, !10, i64 24}
!25 = !{!13, !14, i64 48}


; 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 [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @disk_store_init(i32 noundef %0, ptr noundef readonly %1, ptr noundef %2, ptr noundef readonly %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = tail call noalias dereferenceable_or_null(88) ptr @calloc(i64 noundef 1, i64 noundef 88) #6
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %5
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str) #7
  unreachable

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %6, i64 72
  store i8 1, ptr %10, align 8, !tbaa !5
  %11 = tail call ptr @new_disk_file_header(i8 noundef zeroext 122, i8 noundef zeroext 6) #8
  %12 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr %11, ptr %12, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %6, i64 36
  %14 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %0, ptr %14, align 8, !tbaa !13
  %15 = tail call noalias ptr @strdup(ptr noundef %2) #8
  store ptr %15, ptr %6, align 8, !tbaa !14
  %16 = tail call noalias ptr @strdup(ptr noundef %4) #8
  %17 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %16, ptr %17, align 8, !tbaa !15
  %18 = zext i32 %0 to i64
  %19 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 8) #6
  %20 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr %19, ptr %20, align 8, !tbaa !16
  %21 = icmp eq ptr %19, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %9
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str) #7
  unreachable

23:                                               ; preds = %9
  %24 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 4) #6
  %25 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %24, ptr %25, align 8, !tbaa !17
  %26 = icmp eq ptr %24, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str) #7
  unreachable

28:                                               ; preds = %23
  %29 = icmp eq ptr %1, null
  br i1 %29, label %33, label %30

30:                                               ; preds = %28
  %31 = load ptr, ptr %1, align 8, !tbaa !18
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %38

33:                                               ; preds = %30, %28
  %34 = tail call noalias ptr @fopen(ptr noundef %2, ptr noundef nonnull @.str.1)
  %35 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %34, ptr %35, align 8, !tbaa !19
  %36 = icmp eq ptr %34, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.2, ptr noundef %2) #7
  unreachable

38:                                               ; preds = %30
  %39 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %31, ptr %39, align 8, !tbaa !19
  br label %40

40:                                               ; preds = %33, %38
  %41 = phi ptr [ %34, %33 ], [ %31, %38 ]
  tail call void @write_disk_file_header(ptr noundef nonnull @.str.3, ptr noundef %11, ptr noundef nonnull %41, ptr noundef %15) #8
  %42 = tail call i64 @ftell(ptr noundef nonnull %41)
  %43 = getelementptr inbounds i8, ptr %6, i64 40
  store i64 %42, ptr %43, align 8, !tbaa !20
  %44 = tail call i64 @fwrite(ptr noundef nonnull %14, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %41)
  %.not62 = icmp eq i64 %44, 1
  br i1 %.not62, label %47, label %45

45:                                               ; preds = %40
  %46 = load ptr, ptr %6, align 8, !tbaa !14
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.4, ptr noundef %46) #7
  unreachable

47:                                               ; preds = %40
  %48 = getelementptr inbounds i8, ptr %6, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = tail call i64 @fwrite(ptr noundef nonnull %13, i64 noundef 4, i64 noundef 1, ptr noundef %49)
  %.not63 = icmp eq i64 %50, 1
  br i1 %.not63, label %53, label %51

51:                                               ; preds = %47
  %52 = load ptr, ptr %6, align 8, !tbaa !14
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.5, ptr noundef %52) #7
  unreachable

53:                                               ; preds = %47
  %54 = icmp eq ptr %3, null
  br i1 %54, label %58, label %55

55:                                               ; preds = %53
  %56 = load ptr, ptr %3, align 8, !tbaa !18
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %63

58:                                               ; preds = %55, %53
  %59 = tail call noalias ptr @fopen(ptr noundef %4, ptr noundef nonnull @.str.1)
  %60 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %59, ptr %60, align 8, !tbaa !21
  %61 = icmp eq ptr %59, null
  br i1 %61, label %62, label %65

62:                                               ; preds = %58
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.6, ptr noundef %4) #7
  unreachable

63:                                               ; preds = %55
  %64 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %56, ptr %64, align 8, !tbaa !21
  br label %65

65:                                               ; preds = %58, %63
  %66 = phi ptr [ %59, %58 ], [ %56, %63 ]
  %67 = load i8, ptr %10, align 8, !tbaa !5
  %.not64 = icmp eq i8 %67, 0
  br i1 %.not64, label %71, label %68

68:                                               ; preds = %65
  %69 = load ptr, ptr %12, align 8, !tbaa !12
  %70 = load ptr, ptr %17, align 8, !tbaa !15
  tail call void @write_disk_file_header(ptr noundef nonnull @.str.7, ptr noundef %69, ptr noundef nonnull %66, ptr noundef %70) #8
  br label %71

71:                                               ; preds = %68, %65
  %72 = tail call i64 @ftell(ptr noundef nonnull %66)
  %73 = getelementptr inbounds i8, ptr %6, i64 48
  store i64 %72, ptr %73, align 8, !tbaa !22
  ret ptr %6
}

; 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: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @new_disk_file_header(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #5

declare void @write_disk_file_header(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

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 = { noreturn "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 = { 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 #5 = { 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 #6 = { nounwind allocsize(0,1) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 72}
!6 = !{!"disk_store", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !11, i64 40, !11, i64 48, !7, i64 56, !7, i64 64, !8, i64 72, !7, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !7, i64 80}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !7, i64 56}
!17 = !{!6, !7, i64 64}
!18 = !{!7, !7, i64 0}
!19 = !{!6, !7, i64 16}
!20 = !{!6, !11, i64 40}
!21 = !{!6, !7, i64 24}
!22 = !{!6, !11, i64 48}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass