; LLVM IR from yangfengzzz/Arche-webgpu :: vox.geometry/vertex_centered_scalar_grid2.ll (ZNK3vox25VertexCenteredScalarGrid28dataSizeEv)

; 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.vox::Size2" = type { i64, i64 }
%"class.std::initializer_list" = type { ptr, i64 }

; Function Attrs: mustprogress uwtable
define dso_local { i64, i64 } @_ZNK3vox25VertexCenteredScalarGrid28dataSizeEv(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #0 align 2 {
  %2 = alloca %"struct.vox::Size2", align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.vox::Size2", align 8
  %5 = alloca %"struct.vox::Size2", align 8
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [2 x i32], align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  call void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 0, i64 noundef 0)
  %11 = call noundef zeroext i1 @_ZNK3vox5Size2neERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  br i1 %11, label %12, label %20

12:                                               ; preds = %1
  %13 = getelementptr inbounds i8, ptr %8, i64 8
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88) %13)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef 1, i64 noundef 1)
  %15 = call { i64, i64 } @_ZN3voxplERKNS_5Size2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %16 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 0
  %17 = extractvalue { i64, i64 } %15, 0
  store i64 %17, ptr %16, align 8
  %18 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 1
  %19 = extractvalue { i64, i64 } %15, 1
  store i64 %19, ptr %18, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  br label %24

20:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  %21 = getelementptr inbounds i32, ptr %7, i64 1
  store i32 0, ptr %21, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 0
  store ptr %7, ptr %22, align 8, !tbaa !11
  %23 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 1
  store i64 2, ptr %23, align 8, !tbaa !14
  call void @_ZN3vox5Size2C2IiEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  br label %24

24:                                               ; preds = %20, %12
  %25 = load { i64, i64 }, ptr %2, align 8
  ret { i64, i64 } %25
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox5Size2neERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3voxplERKNS_5Size2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3vox5Size2C2IiEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) 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 = { "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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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, !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 0}
!12 = !{!"_ZTSSt16initializer_listIiE", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}


; 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.vox::Size2" = type { i64, i64 }
%"class.std::initializer_list" = type { ptr, i64 }

; Function Attrs: mustprogress uwtable
define dso_local { i64, i64 } @_ZNK3vox25VertexCenteredScalarGrid28dataSizeEv(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #0 align 2 {
  %2 = alloca %"struct.vox::Size2", align 8
  %3 = alloca %"struct.vox::Size2", align 8
  %4 = alloca %"struct.vox::Size2", align 8
  %5 = alloca %"class.std::initializer_list", align 8
  %6 = alloca [2 x i32], align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef 0, i64 noundef 0)
  %9 = call noundef zeroext i1 @_ZNK3vox5Size2neERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br i1 %9, label %10, label %15

10:                                               ; preds = %1
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 1, i64 noundef 1)
  %12 = call { i64, i64 } @_ZN3voxplERKNS_5Size2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %13 = extractvalue { i64, i64 } %12, 0
  %14 = extractvalue { i64, i64 } %12, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %18

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 0, ptr %16, align 4, !tbaa !5
  store ptr %6, ptr %5, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 2, ptr %17, align 8, !tbaa !13
  call void @_ZN3vox5Size2C2IiEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %.fca.0.load.pre = load i64, ptr %2, align 8
  %.fca.1.gep.phi.trans.insert = getelementptr inbounds i8, ptr %2, i64 8
  %.fca.1.load.pre = load i64, ptr %.fca.1.gep.phi.trans.insert, align 8
  br label %18

18:                                               ; preds = %15, %10
  %.fca.1.load = phi i64 [ %.fca.1.load.pre, %15 ], [ %14, %10 ]
  %.fca.0.load = phi i64 [ %.fca.0.load.pre, %15 ], [ %13, %10 ]
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %.fca.0.load, 0
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %.fca.1.load, 1
  ret { i64, i64 } %.fca.1.insert
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox5Grid210resolutionEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox5Size2neERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox5Size2C2Emm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3voxplERKNS_5Size2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3vox5Size2C2IiEERKSt16initializer_listIT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) 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 = { "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 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listIiE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass