; LLVM IR from frozein/DoonEngine :: src/DoonEngine (voxel)

; 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.DNchunk = type { %struct.DNivec3, i8, i32, i32, [8 x [8 x [8 x %struct.DNcompressedVoxel]]] }
%struct.DNivec3 = type { i32, i32, i32 }
%struct.DNcompressedVoxel = type { i32, i32 }
%struct.DNvolume = type { i32, i32, i32, %struct.DNuvec3, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, %union.QMvec3, %union.QMvec3, float, i32, %union.QMvec3, %union.QMvec3, %union.QMvec3, i32, i32, float, i8, i32, %union.QMvec3, %union.QMvec3, i32, float }
%struct.DNuvec3 = type { i32, i32, i32 }
%union.QMvec3 = type { [3 x float] }

@g_DN_message_callback = external dso_local global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @_DN_compress_chunk(ptr noundef byval(%struct.DNchunk) align 8, ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

declare i32 @fclose(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @DN_save_volume(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [256 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i16, align 2
  %12 = alloca %struct.DNchunk, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call noalias ptr @fopen(ptr noundef %13, ptr noundef @.str.16)
  store ptr %14, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %23, label %17

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #6
  %18 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %18, ptr noundef @.str.17, ptr noundef %19) #6
  %21 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  %22 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  call void %21(i32 noundef 3, i32 noundef 1, ptr noundef %22)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #6
  br label %118

23:                                               ; preds = %2
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.DNvolume, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call i64 @fwrite(ptr noundef %25, i64 noundef 12, i64 noundef 1, ptr noundef %26)
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.DNvolume, ptr %28, i32 0, i32 4
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call i64 @fwrite(ptr noundef %29, i64 noundef 8, i64 noundef 1, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %32 = call noalias ptr @malloc(i64 noundef 8240) #7
  store ptr %32, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %58, %23
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.DNvolume, ptr %36, i32 0, i32 4
  %38 = load i64, ptr %37, align 8, !tbaa !11
  %39 = icmp ult i64 %35, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %33
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %61

41:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DNvolume, ptr %42, i32 0, i32 11
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.DNchunk, ptr %44, i64 %46
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4120, ptr %12) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 4 %47, i64 4120, i1 false), !tbaa.struct !18
  %50 = call zeroext i16 @_DN_compress_chunk(ptr noundef byval(%struct.DNchunk) align 8 %12, ptr noundef %48, ptr noundef %49)
  call void @llvm.lifetime.end.p0(i64 4120, ptr %12) #6
  store i16 %50, ptr %11, align 2, !tbaa !21
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call i64 @fwrite(ptr noundef %11, i64 noundef 2, i64 noundef 1, ptr noundef %51)
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i16, ptr %11, align 2, !tbaa !21
  %55 = zext i16 %54 to i64
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = call i64 @fwrite(ptr noundef %53, i64 noundef %55, i64 noundef 1, ptr noundef %56)
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #6
  br label %58

58:                                               ; preds = %41
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %10, align 4, !tbaa !9
  br label %33, !llvm.loop !23

61:                                               ; preds = %40
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %62) #6
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.DNvolume, ptr %63, i32 0, i32 12
  %65 = load ptr, ptr %64, align 8, !tbaa !25
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call i64 @fwrite(ptr noundef %65, i64 noundef 32, i64 noundef 256, ptr noundef %66)
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.DNvolume, ptr %68, i32 0, i32 15
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = call i64 @fwrite(ptr noundef %69, i64 noundef 12, i64 noundef 1, ptr noundef %70)
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.DNvolume, ptr %72, i32 0, i32 16
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = call i64 @fwrite(ptr noundef %73, i64 noundef 12, i64 noundef 1, ptr noundef %74)
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.DNvolume, ptr %76, i32 0, i32 17
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call i64 @fwrite(ptr noundef %77, i64 noundef 4, i64 noundef 1, ptr noundef %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.DNvolume, ptr %80, i32 0, i32 18
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = call i64 @fwrite(ptr noundef %81, i64 noundef 4, i64 noundef 1, ptr noundef %82)
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.DNvolume, ptr %84, i32 0, i32 19
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = call i64 @fwrite(ptr noundef %85, i64 noundef 12, i64 noundef 1, ptr noundef %86)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.DNvolume, ptr %88, i32 0, i32 20
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = call i64 @fwrite(ptr noundef %89, i64 noundef 12, i64 noundef 1, ptr noundef %90)
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.DNvolume, ptr %92, i32 0, i32 21
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call i64 @fwrite(ptr noundef %93, i64 noundef 12, i64 noundef 1, ptr noundef %94)
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.DNvolume, ptr %96, i32 0, i32 22
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call i64 @fwrite(ptr noundef %97, i64 noundef 4, i64 noundef 1, ptr noundef %98)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.DNvolume, ptr %100, i32 0, i32 23
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = call i64 @fwrite(ptr noundef %101, i64 noundef 4, i64 noundef 1, ptr noundef %102)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.DNvolume, ptr %104, i32 0, i32 24
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = call i64 @fwrite(ptr noundef %105, i64 noundef 4, i64 noundef 1, ptr noundef %106)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.DNvolume, ptr %108, i32 0, i32 27
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = call i64 @fwrite(ptr noundef %109, i64 noundef 12, i64 noundef 1, ptr noundef %110)
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.DNvolume, ptr %112, i32 0, i32 28
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call i64 @fwrite(ptr noundef %113, i64 noundef 12, i64 noundef 1, ptr noundef %114)
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = call i32 @fclose(ptr noundef %116)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %118

118:                                              ; preds = %61, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %119 = load i1, ptr %3, align 1
  ret i1 %119
}

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

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

!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, !14, i64 24}
!12 = !{!"DNvolume", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 12, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !7, i64 124, !15, i64 136, !10, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !10, i64 180, !10, i64 184, !15, i64 188, !16, i64 192, !10, i64 196, !7, i64 200, !7, i64 212, !10, i64 224, !15, i64 228}
!13 = !{!"DNuvec3", !10, i64 0, !10, i64 4, !10, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!12, !6, i64 80}
!18 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 1, !19, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 4096, !20}
!19 = !{!16, !16, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !6, i64 88}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.DNchunk = type { %struct.DNivec3, i8, i32, i32, [8 x [8 x [8 x %struct.DNcompressedVoxel]]] }
%struct.DNivec3 = type { i32, i32, i32 }
%struct.DNcompressedVoxel = type { i32, i32 }

@g_DN_message_callback = external dso_local local_unnamed_addr global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @_DN_compress_chunk(ptr noundef byval(%struct.DNchunk) align 8, ptr noundef, ptr noundef) 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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @DN_save_volume(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca i16, align 2
  %5 = alloca %struct.DNchunk, align 8
  %6 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.16)
  %.not = icmp ne ptr %6, null
  br i1 %.not, label %10, label %7

7:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #6
  %8 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef %0) #6
  %9 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  call void %9(i32 noundef 3, i32 noundef 1, ptr noundef nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #6
  br label %56

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 12
  %12 = tail call i64 @fwrite(ptr noundef nonnull %11, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = tail call i64 @fwrite(ptr noundef nonnull %13, i64 noundef 8, i64 noundef 1, ptr noundef nonnull %6)
  %15 = tail call noalias dereferenceable_or_null(8240) ptr @malloc(i64 noundef 8240) #7
  %16 = load i64, ptr %13, align 8, !tbaa !9
  %.not49 = icmp eq i64 %16, 0
  br i1 %.not49, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %17 = getelementptr inbounds i8, ptr %1, i64 80
  br label %46

._crit_edge:                                      ; preds = %46, %10
  tail call void @free(ptr noundef %15) #6
  %18 = getelementptr inbounds i8, ptr %1, i64 88
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = tail call i64 @fwrite(ptr noundef %19, i64 noundef 32, i64 noundef 256, ptr noundef nonnull %6)
  %21 = getelementptr inbounds i8, ptr %1, i64 112
  %22 = tail call i64 @fwrite(ptr noundef nonnull %21, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %23 = getelementptr inbounds i8, ptr %1, i64 124
  %24 = tail call i64 @fwrite(ptr noundef nonnull %23, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %25 = getelementptr inbounds i8, ptr %1, i64 136
  %26 = tail call i64 @fwrite(ptr noundef nonnull %25, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %6)
  %27 = getelementptr inbounds i8, ptr %1, i64 140
  %28 = tail call i64 @fwrite(ptr noundef nonnull %27, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %6)
  %29 = getelementptr inbounds i8, ptr %1, i64 144
  %30 = tail call i64 @fwrite(ptr noundef nonnull %29, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %31 = getelementptr inbounds i8, ptr %1, i64 156
  %32 = tail call i64 @fwrite(ptr noundef nonnull %31, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %33 = getelementptr inbounds i8, ptr %1, i64 168
  %34 = tail call i64 @fwrite(ptr noundef nonnull %33, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %35 = getelementptr inbounds i8, ptr %1, i64 180
  %36 = tail call i64 @fwrite(ptr noundef nonnull %35, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %6)
  %37 = getelementptr inbounds i8, ptr %1, i64 184
  %38 = tail call i64 @fwrite(ptr noundef nonnull %37, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %6)
  %39 = getelementptr inbounds i8, ptr %1, i64 188
  %40 = tail call i64 @fwrite(ptr noundef nonnull %39, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %6)
  %41 = getelementptr inbounds i8, ptr %1, i64 200
  %42 = tail call i64 @fwrite(ptr noundef nonnull %41, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %43 = getelementptr inbounds i8, ptr %1, i64 212
  %44 = tail call i64 @fwrite(ptr noundef nonnull %43, i64 noundef 12, i64 noundef 1, ptr noundef nonnull %6)
  %45 = tail call i32 @fclose(ptr noundef nonnull %6)
  br label %56

46:                                               ; preds = %.lr.ph, %46
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #6
  %47 = load ptr, ptr %17, align 8, !tbaa !17
  %48 = getelementptr inbounds %struct.DNchunk, ptr %47, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 4120, ptr nonnull %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(4120) %5, ptr noundef nonnull align 4 dereferenceable(4120) %48, i64 4120, i1 false), !tbaa.struct !18
  %49 = tail call zeroext i16 @_DN_compress_chunk(ptr noundef nonnull byval(%struct.DNchunk) align 8 %5, ptr noundef nonnull %1, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 4120, ptr nonnull %5) #6
  store i16 %49, ptr %4, align 2, !tbaa !22
  %50 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 2, i64 noundef 1, ptr noundef nonnull %6)
  %51 = load i16, ptr %4, align 2, !tbaa !22
  %52 = zext i16 %51 to i64
  %53 = tail call i64 @fwrite(ptr noundef %15, i64 noundef %52, i64 noundef 1, ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = load i64, ptr %13, align 8, !tbaa !9
  %55 = icmp ugt i64 %54, %indvars.iv.next
  br i1 %55, label %46, label %._crit_edge, !llvm.loop !24

56:                                               ; preds = %._crit_edge, %7
  ret i1 %.not
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 }
attributes #7 = { 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, !13, i64 24}
!10 = !{!"DNvolume", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 12, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !7, i64 124, !14, i64 136, !11, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !11, i64 180, !11, i64 184, !14, i64 188, !15, i64 192, !11, i64 196, !7, i64 200, !7, i64 212, !11, i64 224, !14, i64 228}
!11 = !{!"int", !7, i64 0}
!12 = !{!"DNuvec3", !11, i64 0, !11, i64 4, !11, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!10, !6, i64 88}
!17 = !{!10, !6, i64 80}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 12, i64 1, !20, i64 16, i64 4, !19, i64 20, i64 4, !19, i64 24, i64 4096, !21}
!19 = !{!11, !11, i64 0}
!20 = !{!15, !15, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"short", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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