; LLVM IR from aap/librw :: src/geoplg.ll (ZN2rw8Geometry14allocateMeshesEiji)

; 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.rw::Geometry" = type { %"struct.rw::Object", i32, i16, i32, i32, i32, i32, ptr, ptr, [8 x ptr], ptr, %"struct.rw::MaterialList", ptr, ptr, i32 }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }
%"struct.rw::MaterialList" = type { ptr, i32, i32 }
%"struct.rw::MeshHeader" = type { i32, i16, i16, i32, i32 }
%"struct.rw::Mesh" = type { ptr, i32, ptr }

@.str = external hidden unnamed_addr constant [73 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZN2rwL13nextSerialNumE = external hidden global i16, align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %15 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = mul i64 %17, 24
  %19 = add i64 16, %18
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %9, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %31, label %23

23:                                               ; preds = %4
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = mul i64 %25, 2
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = zext i32 %27 to i64
  %29 = add i64 %28, %26
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %9, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %23, %4
  %32 = getelementptr inbounds %"struct.rw::Geometry", ptr %15, i32 0, i32 12
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %48

35:                                               ; preds = %31
  %36 = getelementptr inbounds %"struct.rw::Geometry", ptr %15, i32 0, i32 12
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %37, i32 0, i32 1
  %39 = load i16, ptr %38, align 4, !tbaa !16
  %40 = zext i16 %39 to i32
  store i32 %40, ptr %13, align 4, !tbaa !9
  %41 = getelementptr inbounds %"struct.rw::Geometry", ptr %15, i32 0, i32 12
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = call noundef ptr @_ZN2rw15mustrealloc_LOCEPvmjPKc(ptr noundef %42, i64 noundef %44, i32 noundef 196623, ptr noundef @.str)
  store ptr %45, ptr %10, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.rw::Geometry", ptr %15, i32 0, i32 12
  store ptr %46, ptr %47, align 8, !tbaa !11
  br label %56

48:                                               ; preds = %31
  store i32 0, ptr %13, align 4, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %50, i32 noundef 196623, ptr noundef @.str.1)
  store ptr %51, ptr %10, align 8, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %52, i32 0, i32 0
  store i32 0, ptr %53, align 4, !tbaa !18
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.rw::Geometry", ptr %15, i32 0, i32 12
  store ptr %54, ptr %55, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %48, %35
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = trunc i32 %57 to i16
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %59, i32 0, i32 1
  store i16 %58, ptr %60, align 4, !tbaa !16
  %61 = load i16, ptr @_ZN2rwL13nextSerialNumE, align 2, !tbaa !19
  %62 = add i16 %61, 1
  store i16 %62, ptr @_ZN2rwL13nextSerialNumE, align 2, !tbaa !19
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %63, i32 0, i32 2
  store i16 %61, ptr %64, align 2, !tbaa !20
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %66, i32 0, i32 3
  store i32 %65, ptr %67, align 4, !tbaa !21
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = call noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16) %68)
  store ptr %69, ptr %11, align 8, !tbaa !5
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %"struct.rw::Mesh", ptr %70, i64 %72
  store ptr %73, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %109, %56
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.rw::MeshHeader", ptr %76, i32 0, i32 1
  %78 = load i16, ptr %77, align 4, !tbaa !16
  %79 = zext i16 %78 to i32
  %80 = icmp slt i32 %75, %79
  br i1 %80, label %81, label %112

81:                                               ; preds = %74
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = icmp sge i32 %82, %83
  br i1 %84, label %85, label %90

85:                                               ; preds = %81
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.rw::Mesh", ptr %86, i32 0, i32 2
  store ptr null, ptr %87, align 8, !tbaa !22
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.rw::Mesh", ptr %88, i32 0, i32 1
  store i32 0, ptr %89, align 8, !tbaa !24
  br label %90

90:                                               ; preds = %85, %81
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.rw::Mesh", ptr %94, i32 0, i32 0
  store ptr null, ptr %95, align 8, !tbaa !25
  br label %106

96:                                               ; preds = %90
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.rw::Mesh", ptr %98, i32 0, i32 0
  store ptr %97, ptr %99, align 8, !tbaa !25
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.rw::Mesh", ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 8, !tbaa !24
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = zext i32 %102 to i64
  %105 = getelementptr inbounds i16, ptr %103, i64 %104
  store ptr %105, ptr %12, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %96, %93
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.rw::Mesh", ptr %107, i32 1
  store ptr %108, ptr %11, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %106
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %14, align 4, !tbaa !9
  br label %74, !llvm.loop !26

112:                                              ; preds = %74
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret ptr %113
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw15mustrealloc_LOCEPvmjPKc(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

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

attributes #0 = { mustprogress 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 144}
!12 = !{!"_ZTSN2rw8GeometryE", !13, i64 0, !10, i64 16, !14, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !15, i64 128, !6, i64 144, !6, i64 152, !10, i64 160}
!13 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSN2rw12MaterialListE", !6, i64 0, !10, i64 8, !10, i64 12}
!16 = !{!17, !14, i64 4}
!17 = !{!"_ZTSN2rw10MeshHeaderE", !10, i64 0, !14, i64 4, !14, i64 6, !10, i64 8, !10, i64 12}
!18 = !{!17, !10, i64 0}
!19 = !{!14, !14, i64 0}
!20 = !{!17, !14, i64 6}
!21 = !{!17, !10, i64 8}
!22 = !{!23, !6, i64 16}
!23 = !{!"_ZTSN2rw4MeshE", !6, i64 0, !10, i64 8, !6, i64 16}
!24 = !{!23, !10, i64 8}
!25 = !{!23, !6, i64 0}
!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.rw::Mesh" = type { ptr, i32, ptr }

@.str = external hidden unnamed_addr constant [73 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZN2rwL13nextSerialNumE = external hidden local_unnamed_addr global i16, align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2rw8Geometry14allocateMeshesEiji(ptr nocapture noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = sext i32 %1 to i64
  %6 = mul i32 %1, 24
  %7 = add i32 %6, 16
  %.not = icmp eq i32 %3, 0
  %8 = shl i32 %2, 1
  %9 = select i1 %.not, i32 %8, i32 0
  %.036 = add i32 %7, %9
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %.not38 = icmp eq ptr %11, null
  br i1 %.not38, label %18, label %12

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %11, i64 4
  %14 = load i16, ptr %13, align 4, !tbaa !14
  %15 = zext i16 %14 to i32
  %16 = zext i32 %.036 to i64
  %17 = tail call noundef ptr @_ZN2rw15mustrealloc_LOCEPvmjPKc(ptr noundef nonnull %11, i64 noundef %16, i32 noundef 196623, ptr noundef nonnull @.str)
  br label %21

18:                                               ; preds = %4
  %19 = zext i32 %.036 to i64
  %20 = tail call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %19, i32 noundef 196623, ptr noundef nonnull @.str.1)
  store i32 0, ptr %20, align 4, !tbaa !16
  br label %21

21:                                               ; preds = %18, %12
  %storemerge = phi ptr [ %20, %18 ], [ %17, %12 ]
  %.032 = phi i32 [ 0, %18 ], [ %15, %12 ]
  store ptr %storemerge, ptr %10, align 8, !tbaa !5
  %22 = trunc i32 %1 to i16
  %23 = getelementptr inbounds i8, ptr %storemerge, i64 4
  store i16 %22, ptr %23, align 4, !tbaa !14
  %24 = load i16, ptr @_ZN2rwL13nextSerialNumE, align 2, !tbaa !17
  %25 = add i16 %24, 1
  store i16 %25, ptr @_ZN2rwL13nextSerialNumE, align 2, !tbaa !17
  %26 = getelementptr inbounds i8, ptr %storemerge, i64 6
  store i16 %24, ptr %26, align 2, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %storemerge, i64 8
  store i32 %2, ptr %27, align 4, !tbaa !19
  %28 = tail call noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16) %storemerge)
  %29 = load i16, ptr %23, align 4, !tbaa !14
  %30 = zext i16 %29 to i32
  %.not43 = icmp eq i16 %29, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21
  br i1 %.not, label %.lr.ph.split.us.preheader, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.lr.ph
  %xtraiter = and i32 %30, 1
  %31 = icmp eq i16 %29, 1
  br i1 %31, label %._crit_edge.loopexit48.unr-lcssa, label %.lr.ph.split.preheader.new

.lr.ph.split.preheader.new:                       ; preds = %.lr.ph.split.preheader
  %unroll_iter = and i32 %30, 65534
  br label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph
  %32 = getelementptr inbounds %"struct.rw::Mesh", ptr %28, i64 %5
  %xtraiter49 = and i32 %30, 1
  %33 = icmp eq i16 %29, 1
  br i1 %33, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split.us.preheader.new

.lr.ph.split.us.preheader.new:                    ; preds = %.lr.ph.split.us.preheader
  %unroll_iter51 = and i32 %30, 65534
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %45, %.lr.ph.split.us.preheader.new
  %.042.us = phi i32 [ 0, %.lr.ph.split.us.preheader.new ], [ %50, %45 ]
  %.03341.us = phi ptr [ %32, %.lr.ph.split.us.preheader.new ], [ %48, %45 ]
  %.03440.us = phi ptr [ %28, %.lr.ph.split.us.preheader.new ], [ %49, %45 ]
  %niter52 = phi i32 [ 0, %.lr.ph.split.us.preheader.new ], [ %niter52.next.1, %45 ]
  %.not39.us = icmp ult i32 %.042.us, %.032
  br i1 %.not39.us, label %.lr.ph.split.us._crit_edge, label %34

.lr.ph.split.us._crit_edge:                       ; preds = %.lr.ph.split.us
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.03440.us, i64 8
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !20
  br label %.lr.ph.split.us.1

34:                                               ; preds = %.lr.ph.split.us
  %35 = getelementptr inbounds i8, ptr %.03440.us, i64 16
  store ptr null, ptr %35, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %.03440.us, i64 8
  store i32 0, ptr %36, align 8, !tbaa !20
  br label %.lr.ph.split.us.1

.lr.ph.split.us.1:                                ; preds = %.lr.ph.split.us._crit_edge, %34
  %37 = phi i32 [ %.pre, %.lr.ph.split.us._crit_edge ], [ 0, %34 ]
  store ptr %.03341.us, ptr %.03440.us, align 8, !tbaa !23
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i16, ptr %.03341.us, i64 %38
  %40 = getelementptr inbounds i8, ptr %.03440.us, i64 24
  %41 = or disjoint i32 %.042.us, 1
  %.not39.us.1 = icmp ult i32 %41, %.032
  br i1 %.not39.us.1, label %.lr.ph.split.us._crit_edge.1, label %42

42:                                               ; preds = %.lr.ph.split.us.1
  %43 = getelementptr inbounds i8, ptr %.03440.us, i64 40
  store ptr null, ptr %43, align 8, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %.03440.us, i64 32
  store i32 0, ptr %44, align 8, !tbaa !20
  br label %45

.lr.ph.split.us._crit_edge.1:                     ; preds = %.lr.ph.split.us.1
  %.phi.trans.insert.1 = getelementptr inbounds i8, ptr %.03440.us, i64 32
  %.pre.1 = load i32, ptr %.phi.trans.insert.1, align 8, !tbaa !20
  br label %45

45:                                               ; preds = %.lr.ph.split.us._crit_edge.1, %42
  %46 = phi i32 [ %.pre.1, %.lr.ph.split.us._crit_edge.1 ], [ 0, %42 ]
  store ptr %39, ptr %40, align 8, !tbaa !23
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i16, ptr %39, i64 %47
  %49 = getelementptr inbounds i8, ptr %.03440.us, i64 48
  %50 = add nuw nsw i32 %.042.us, 2
  %niter52.next.1 = add i32 %niter52, 2
  %niter52.ncmp.1 = icmp eq i32 %niter52.next.1, %unroll_iter51
  br i1 %niter52.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split.us, !llvm.loop !24

.lr.ph.split:                                     ; preds = %59, %.lr.ph.split.preheader.new
  %.042 = phi i32 [ 0, %.lr.ph.split.preheader.new ], [ %61, %59 ]
  %.03440 = phi ptr [ %28, %.lr.ph.split.preheader.new ], [ %60, %59 ]
  %niter = phi i32 [ 0, %.lr.ph.split.preheader.new ], [ %niter.next.1, %59 ]
  %.not39 = icmp ult i32 %.042, %.032
  br i1 %.not39, label %.lr.ph.split.1, label %51

51:                                               ; preds = %.lr.ph.split
  %52 = getelementptr inbounds i8, ptr %.03440, i64 16
  store ptr null, ptr %52, align 8, !tbaa !22
  %53 = getelementptr inbounds i8, ptr %.03440, i64 8
  store i32 0, ptr %53, align 8, !tbaa !20
  br label %.lr.ph.split.1

.lr.ph.split.1:                                   ; preds = %51, %.lr.ph.split
  store ptr null, ptr %.03440, align 8, !tbaa !23
  %54 = getelementptr inbounds i8, ptr %.03440, i64 24
  %55 = or disjoint i32 %.042, 1
  %.not39.1 = icmp ult i32 %55, %.032
  br i1 %.not39.1, label %59, label %56

56:                                               ; preds = %.lr.ph.split.1
  %57 = getelementptr inbounds i8, ptr %.03440, i64 40
  store ptr null, ptr %57, align 8, !tbaa !22
  %58 = getelementptr inbounds i8, ptr %.03440, i64 32
  store i32 0, ptr %58, align 8, !tbaa !20
  br label %59

59:                                               ; preds = %56, %.lr.ph.split.1
  store ptr null, ptr %54, align 8, !tbaa !23
  %60 = getelementptr inbounds i8, ptr %.03440, i64 48
  %61 = add nuw nsw i32 %.042, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit48.unr-lcssa, label %.lr.ph.split, !llvm.loop !24

._crit_edge.loopexit.unr-lcssa:                   ; preds = %45, %.lr.ph.split.us.preheader
  %.042.us.unr = phi i32 [ 0, %.lr.ph.split.us.preheader ], [ %50, %45 ]
  %.03341.us.unr = phi ptr [ %32, %.lr.ph.split.us.preheader ], [ %48, %45 ]
  %.03440.us.unr = phi ptr [ %28, %.lr.ph.split.us.preheader ], [ %49, %45 ]
  %lcmp.mod50.not = icmp eq i32 %xtraiter49, 0
  br i1 %lcmp.mod50.not, label %._crit_edge, label %.lr.ph.split.us.epil

.lr.ph.split.us.epil:                             ; preds = %._crit_edge.loopexit.unr-lcssa
  %.not39.us.epil = icmp ult i32 %.042.us.unr, %.032
  br i1 %.not39.us.epil, label %._crit_edge.loopexit.epilog-lcssa, label %62

62:                                               ; preds = %.lr.ph.split.us.epil
  %63 = getelementptr inbounds i8, ptr %.03440.us.unr, i64 16
  store ptr null, ptr %63, align 8, !tbaa !22
  %64 = getelementptr inbounds i8, ptr %.03440.us.unr, i64 8
  store i32 0, ptr %64, align 8, !tbaa !20
  br label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %.lr.ph.split.us.epil, %62
  store ptr %.03341.us.unr, ptr %.03440.us.unr, align 8, !tbaa !23
  br label %._crit_edge

._crit_edge.loopexit48.unr-lcssa:                 ; preds = %59, %.lr.ph.split.preheader
  %.042.unr = phi i32 [ 0, %.lr.ph.split.preheader ], [ %61, %59 ]
  %.03440.unr = phi ptr [ %28, %.lr.ph.split.preheader ], [ %60, %59 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.split.epil

.lr.ph.split.epil:                                ; preds = %._crit_edge.loopexit48.unr-lcssa
  %.not39.epil = icmp ult i32 %.042.unr, %.032
  br i1 %.not39.epil, label %._crit_edge.loopexit48.epilog-lcssa, label %65

65:                                               ; preds = %.lr.ph.split.epil
  %66 = getelementptr inbounds i8, ptr %.03440.unr, i64 16
  store ptr null, ptr %66, align 8, !tbaa !22
  %67 = getelementptr inbounds i8, ptr %.03440.unr, i64 8
  store i32 0, ptr %67, align 8, !tbaa !20
  br label %._crit_edge.loopexit48.epilog-lcssa

._crit_edge.loopexit48.epilog-lcssa:              ; preds = %65, %.lr.ph.split.epil
  store ptr null, ptr %.03440.unr, align 8, !tbaa !23
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit48.epilog-lcssa, %._crit_edge.loopexit48.unr-lcssa, %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %21
  ret ptr %storemerge
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw15mustrealloc_LOCEPvmjPKc(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw10MeshHeader9getMeshesEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 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" }

!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, !10, i64 144}
!6 = !{!"_ZTSN2rw8GeometryE", !7, i64 0, !11, i64 16, !12, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !10, i64 40, !10, i64 48, !8, i64 56, !10, i64 120, !13, i64 128, !10, i64 144, !10, i64 152, !11, i64 160}
!7 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !10, i64 8}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"_ZTSN2rw12MaterialListE", !10, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!15, !12, i64 4}
!15 = !{!"_ZTSN2rw10MeshHeaderE", !11, i64 0, !12, i64 4, !12, i64 6, !11, i64 8, !11, i64 12}
!16 = !{!15, !11, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!15, !12, i64 6}
!19 = !{!15, !11, i64 8}
!20 = !{!21, !11, i64 8}
!21 = !{!"_ZTSN2rw4MeshE", !10, i64 0, !11, i64 8, !10, i64 16}
!22 = !{!21, !10, i64 16}
!23 = !{!21, !10, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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