; 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.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] }
%struct.DNvoxelNode = type { i32, i64, %struct.DNivec3 }
%struct.DNivec3 = type { i32, i32, i32 }

@g_DN_message_callback = external dso_local global ptr, align 8
@glad_glDeleteBuffers = external global ptr, align 8
@glad_glBindBuffer = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@.str.48 = external hidden unnamed_addr constant [49 x i8], align 1
@glad_glGenBuffers = external global ptr, align 8
@.str.49 = external hidden unnamed_addr constant [34 x i8], align 1
@glad_glCopyBufferSubData = external global ptr, align 8

; 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: nounwind uwtable
define dso_local zeroext i1 @DN_set_max_voxels_gpu(ptr noundef %0, i64 noundef %1) #1 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.DNvolume, ptr %14, i32 0, i32 14
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load i64, ptr %5, align 8, !tbaa !9
  %18 = udiv i64 %17, 16
  %19 = mul i64 32, %18
  %20 = call ptr @realloc(ptr noundef %16, i64 noundef %19) #4
  store ptr %20, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %25, label %23

23:                                               ; preds = %2
  %24 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  call void %24(i32 noundef 0, i32 noundef 1, ptr noundef @.str.48)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %125

25:                                               ; preds = %2
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.DNvolume, ptr %27, i32 0, i32 14
  store ptr %26, ptr %28, align 8, !tbaa !11
  call void @_DN_clear_gl_errors()
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %29 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %29(i32 noundef 1, ptr noundef %8)
  %30 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !17
  call void %30(i32 noundef 37074, i32 noundef %31)
  %32 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %33 = load i64, ptr %5, align 8, !tbaa !9
  %34 = add i64 %33, 512
  %35 = mul i64 %34, 16
  call void %32(i32 noundef 37074, i64 noundef %35, ptr noundef null, i32 noundef 35048)
  %36 = call zeroext i1 @_DN_gl_error()
  br i1 %36, label %37, label %39

37:                                               ; preds = %25
  %38 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  call void %38(i32 noundef 1, i32 noundef 1, ptr noundef @.str.49)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %124

39:                                               ; preds = %25
  %40 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.DNvolume, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 8, !tbaa !18
  call void %40(i32 noundef 36662, i32 noundef %43)
  %44 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !17
  call void %44(i32 noundef 36663, i32 noundef %45)
  %46 = load ptr, ptr @glad_glCopyBufferSubData, align 8, !tbaa !5
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.DNvolume, ptr %47, i32 0, i32 6
  %49 = load i64, ptr %48, align 8, !tbaa !19
  %50 = mul i64 %49, 16
  call void %46(i32 noundef 36662, i32 noundef 36663, i64 noundef 0, i64 noundef 0, i64 noundef %50)
  %51 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.DNvolume, ptr %52, i32 0, i32 2
  call void %51(i32 noundef 1, ptr noundef %53)
  %54 = load i32, ptr %8, align 4, !tbaa !17
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.DNvolume, ptr %55, i32 0, i32 2
  store i32 %54, ptr %56, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %57 = load i64, ptr %5, align 8, !tbaa !9
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.DNvolume, ptr %58, i32 0, i32 6
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = sub i64 %57, %60
  store i64 %61, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %62 = load i64, ptr %9, align 8, !tbaa !9
  %63 = udiv i64 %62, 512
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %10, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.DNvolume, ptr %65, i32 0, i32 7
  %67 = load i64, ptr %66, align 8, !tbaa !20
  %68 = trunc i64 %67 to i32
  store i32 %68, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.DNvolume, ptr %69, i32 0, i32 6
  %71 = load i64, ptr %70, align 8, !tbaa !19
  store i64 %71, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %111, %39
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = load i32, ptr %10, align 4, !tbaa !17
  %75 = sext i32 %74 to i64
  %76 = icmp ult i64 %73, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %72
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %114

78:                                               ; preds = %72
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.DNvolume, ptr %79, i32 0, i32 14
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = load i32, ptr %11, align 4, !tbaa !17
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr %13, align 8, !tbaa !9
  %85 = add i64 %83, %84
  %86 = getelementptr inbounds %struct.DNvoxelNode, ptr %81, i64 %85
  %87 = getelementptr inbounds %struct.DNvoxelNode, ptr %86, i32 0, i32 2
  %88 = getelementptr inbounds %struct.DNivec3, ptr %87, i32 0, i32 0
  store i32 -1, ptr %88, align 8, !tbaa !21
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.DNvolume, ptr %89, i32 0, i32 14
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load i32, ptr %11, align 4, !tbaa !17
  %93 = sext i32 %92 to i64
  %94 = load i64, ptr %13, align 8, !tbaa !9
  %95 = add i64 %93, %94
  %96 = getelementptr inbounds %struct.DNvoxelNode, ptr %91, i64 %95
  %97 = getelementptr inbounds %struct.DNvoxelNode, ptr %96, i32 0, i32 0
  store i32 512, ptr %97, align 8, !tbaa !24
  %98 = load i64, ptr %12, align 8, !tbaa !9
  %99 = load i64, ptr %13, align 8, !tbaa !9
  %100 = mul i64 %99, 512
  %101 = add i64 %98, %100
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.DNvolume, ptr %102, i32 0, i32 14
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = load i32, ptr %11, align 4, !tbaa !17
  %106 = sext i32 %105 to i64
  %107 = load i64, ptr %13, align 8, !tbaa !9
  %108 = add i64 %106, %107
  %109 = getelementptr inbounds %struct.DNvoxelNode, ptr %104, i64 %108
  %110 = getelementptr inbounds %struct.DNvoxelNode, ptr %109, i32 0, i32 1
  store i64 %101, ptr %110, align 8, !tbaa !25
  br label %111

111:                                              ; preds = %78
  %112 = load i64, ptr %13, align 8, !tbaa !9
  %113 = add i64 %112, 1
  store i64 %113, ptr %13, align 8, !tbaa !9
  br label %72, !llvm.loop !26

114:                                              ; preds = %77
  %115 = load i32, ptr %10, align 4, !tbaa !17
  %116 = sext i32 %115 to i64
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.DNvolume, ptr %117, i32 0, i32 7
  %119 = load i64, ptr %118, align 8, !tbaa !20
  %120 = add i64 %119, %116
  store i64 %120, ptr %118, align 8, !tbaa !20
  %121 = load i64, ptr %5, align 8, !tbaa !9
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.DNvolume, ptr %122, i32 0, i32 6
  store i64 %121, ptr %123, align 8, !tbaa !19
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %124

124:                                              ; preds = %114, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %125

125:                                              ; preds = %124, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %126 = load i1, ptr %3, align 1
  ret i1 %126
}

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

; Function Attrs: nounwind uwtable
declare hidden void @_DN_clear_gl_errors() #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_DN_gl_error() #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nounwind }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 104}
!12 = !{!"DNvolume", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 12, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, 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, !13, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !13, i64 180, !13, i64 184, !15, i64 188, !16, i64 192, !13, i64 196, !7, i64 200, !7, i64 212, !13, i64 224, !15, i64 228}
!13 = !{!"int", !7, i64 0}
!14 = !{!"DNuvec3", !13, i64 0, !13, i64 4, !13, i64 8}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !10, i64 40}
!20 = !{!12, !10, i64 48}
!21 = !{!22, !13, i64 16}
!22 = !{!"DNvoxelNode", !13, i64 0, !10, i64 8, !23, i64 16}
!23 = !{!"DNivec3", !13, i64 0, !13, i64 4, !13, i64 8}
!24 = !{!22, !13, i64 0}
!25 = !{!22, !10, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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.DNvoxelNode = type { i32, i64, %struct.DNivec3 }
%struct.DNivec3 = type { i32, i32, i32 }

@g_DN_message_callback = external dso_local local_unnamed_addr global ptr, align 8
@glad_glDeleteBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@.str.48 = external hidden unnamed_addr constant [49 x i8], align 1
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@.str.49 = external hidden unnamed_addr constant [34 x i8], align 1
@glad_glCopyBufferSubData = external local_unnamed_addr global ptr, align 8

; 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: nounwind uwtable
define dso_local noundef zeroext i1 @DN_set_max_voxels_gpu(ptr noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = shl i64 %1, 1
  %7 = and i64 %6, -32
  %8 = tail call ptr @realloc(ptr noundef %5, i64 noundef %7) #4
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %11

9:                                                ; preds = %2
  %10 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !15
  tail call void %10(i32 noundef 0, i32 noundef 1, ptr noundef nonnull @.str.48) #5
  br label %65

11:                                               ; preds = %2
  store ptr %8, ptr %4, align 8, !tbaa !5
  tail call void @_DN_clear_gl_errors()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %12 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !15
  call void %12(i32 noundef 1, ptr noundef nonnull %3) #5
  %13 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !15
  %14 = load i32, ptr %3, align 4, !tbaa !16
  call void %13(i32 noundef 37074, i32 noundef %14) #5
  %15 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !15
  %16 = shl i64 %1, 4
  %17 = add i64 %16, 8192
  call void %15(i32 noundef 37074, i64 noundef %17, ptr noundef null, i32 noundef 35048) #5
  %18 = call zeroext i1 @_DN_gl_error()
  br i1 %18, label %19, label %21

19:                                               ; preds = %11
  %20 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !15
  call void %20(i32 noundef 1, i32 noundef 1, ptr noundef nonnull @.str.49) #5
  br label %64

21:                                               ; preds = %11
  %22 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !17
  call void %22(i32 noundef 36662, i32 noundef %24) #5
  %25 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !15
  %26 = load i32, ptr %3, align 4, !tbaa !16
  call void %25(i32 noundef 36663, i32 noundef %26) #5
  %27 = load ptr, ptr @glad_glCopyBufferSubData, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %0, i64 40
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = shl i64 %29, 4
  call void %27(i32 noundef 36662, i32 noundef 36663, i64 noundef 0, i64 noundef 0, i64 noundef %30) #5
  %31 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !15
  call void %31(i32 noundef 1, ptr noundef nonnull %23) #5
  %32 = load i32, ptr %3, align 4, !tbaa !16
  store i32 %32, ptr %23, align 8, !tbaa !17
  %33 = load i64, ptr %28, align 8, !tbaa !18
  %34 = sub i64 %1, %33
  %35 = getelementptr inbounds i8, ptr %0, i64 48
  %36 = load i64, ptr %35, align 8, !tbaa !19
  %37 = shl i64 %34, 23
  %38 = ashr i64 %37, 32
  %.not37 = icmp ult i64 %37, 4294967296
  br i1 %.not37, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %sext = shl i64 %36, 32
  %40 = ashr exact i64 %sext, 32
  %umax = call i64 @llvm.umax.i64(i64 %38, i64 1)
  %xtraiter = and i64 %umax, 1
  %41 = icmp ult i64 %38, 2
  br i1 %41, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %umax, -2
  br label %49

._crit_edge.loopexit.unr-lcssa:                   ; preds = %49, %.lr.ph
  %.036.unr = phi i64 [ 0, %.lr.ph ], [ %63, %49 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %42 = add i64 %.036.unr, %40
  %43 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %42, i32 2
  store i32 -1, ptr %43, align 8, !tbaa !20
  %44 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %42
  store i32 512, ptr %44, align 8, !tbaa !23
  %45 = shl i64 %.036.unr, 9
  %46 = add i64 %45, %33
  %47 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %42, i32 1
  store i64 %46, ptr %47, align 8, !tbaa !24
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %21
  %48 = add i64 %38, %36
  store i64 %48, ptr %35, align 8, !tbaa !19
  store i64 %1, ptr %28, align 8, !tbaa !18
  br label %64

49:                                               ; preds = %49, %.lr.ph.new
  %.036 = phi i64 [ 0, %.lr.ph.new ], [ %63, %49 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %49 ]
  %50 = add i64 %.036, %40
  %51 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %50, i32 2
  store i32 -1, ptr %51, align 8, !tbaa !20
  %52 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %50
  store i32 512, ptr %52, align 8, !tbaa !23
  %53 = shl i64 %.036, 9
  %54 = add i64 %53, %33
  %55 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %50, i32 1
  store i64 %54, ptr %55, align 8, !tbaa !24
  %56 = or disjoint i64 %.036, 1
  %57 = add i64 %56, %40
  %58 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %57, i32 2
  store i32 -1, ptr %58, align 8, !tbaa !20
  %59 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %57
  store i32 512, ptr %59, align 8, !tbaa !23
  %60 = shl i64 %56, 9
  %61 = add i64 %60, %33
  %62 = getelementptr inbounds %struct.DNvoxelNode, ptr %39, i64 %57, i32 1
  store i64 %61, ptr %62, align 8, !tbaa !24
  %63 = add nuw i64 %.036, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %49, !llvm.loop !25

64:                                               ; preds = %._crit_edge, %19
  %.033 = xor i1 %18, true
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %65

65:                                               ; preds = %64, %9
  %.1 = phi i1 [ %.033, %64 ], [ false, %9 ]
  ret i1 %.1
}

; 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 #2

; Function Attrs: nounwind uwtable
declare hidden void @_DN_clear_gl_errors() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_DN_gl_error() local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind allocsize(1) }
attributes #5 = { 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, !12, i64 104}
!6 = !{!"DNvolume", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !8, i64 112, !8, i64 124, !13, i64 136, !7, i64 140, !8, i64 144, !8, i64 156, !8, i64 168, !7, i64 180, !7, i64 184, !13, i64 188, !14, i64 192, !7, i64 196, !8, i64 200, !8, i64 212, !7, i64 224, !13, i64 228}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"DNuvec3", !7, i64 0, !7, i64 4, !7, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !7, i64 8}
!18 = !{!6, !11, i64 40}
!19 = !{!6, !11, i64 48}
!20 = !{!21, !7, i64 16}
!21 = !{!"DNvoxelNode", !7, i64 0, !11, i64 8, !22, i64 16}
!22 = !{!"DNivec3", !7, i64 0, !7, i64 4, !7, i64 8}
!23 = !{!21, !7, i64 0}
!24 = !{!21, !11, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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