; LLVM IR from INMOST-DEV/INMOST-FEM :: anifem++/fem (tetdofmap)

; 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.std::array.2" = type { [6 x i32] }
%"struct.std::array.3" = type { [4 x i32] }
%"struct.Ani::DofT::TetGeomSparsity::Pos" = type { i8, i8 }
%"struct.std::pair.4" = type <{ i32, %"struct.Ani::DofT::LocSymOrder", [2 x i8] }>
%"struct.Ani::DofT::LocSymOrder" = type { i8, i8 }
%"struct.Ani::DofT::LocGeomOrder" = type <{ i32, i8, i8, [2 x i8] }>
%"struct.Ani::DofT::LocalOrder" = type { i32, i32, i8, i8, i8, i8 }

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4), i8 noundef zeroext) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i16 @_ZNK3Ani4DofT15TetGeomSparsity8beginPosEh(ptr noundef nonnull align 1 dereferenceable(4), i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani4DofT10BaseDofMap19BeginByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 1 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, i1 noundef zeroext %3) unnamed_addr #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca %"struct.std::array.2", align 4
  %10 = alloca %"struct.std::array.3", align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca %"struct.Ani::DofT::TetGeomSparsity::Pos", align 1
  %14 = alloca %"struct.std::pair.4", align 4
  %15 = alloca %"struct.Ani::DofT::LocGeomOrder", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %16 = zext i1 %3 to i8
  store i8 %16, ptr %8, align 1, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds ptr, ptr %18, i64 4
  %20 = load ptr, ptr %19, align 8
  call void %20(ptr dead_on_unwind writable sret(%"struct.std::array.2") align 4 %9, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  %21 = getelementptr inbounds %"struct.std::array.3", ptr %10, i32 0, i32 0
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 0) #4
  %23 = load i32, ptr %22, align 4, !tbaa !13
  store i32 %23, ptr %21, align 4, !tbaa !13
  %24 = getelementptr inbounds i32, ptr %21, i64 1
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 1) #4
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 2) #4
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = add i32 %26, %28
  store i32 %29, ptr %24, align 4, !tbaa !13
  %30 = getelementptr inbounds i32, ptr %21, i64 2
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 3) #4
  %32 = load i32, ptr %31, align 4, !tbaa !13
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 4) #4
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = add i32 %32, %34
  store i32 %35, ptr %30, align 4, !tbaa !13
  %36 = getelementptr inbounds i32, ptr %21, i64 3
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 5) #4
  %38 = load i32, ptr %37, align 4, !tbaa !13
  store i32 %38, ptr %36, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  store i8 0, ptr %11, align 1, !tbaa !15
  br label %39

39:                                               ; preds = %113, %4
  %40 = load i8, ptr %11, align 1, !tbaa !15
  %41 = zext i8 %40 to i32
  %42 = icmp slt i32 %41, 4
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 2, ptr %12, align 4
  br label %116

44:                                               ; preds = %39
  %45 = load i8, ptr %11, align 1, !tbaa !15
  %46 = zext i8 %45 to i64
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %10, i64 noundef %46) #4
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %112

50:                                               ; preds = %44
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i8, ptr %11, align 1, !tbaa !15
  %53 = call noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4) %51, i8 noundef zeroext %52)
  br i1 %53, label %112, label %54

54:                                               ; preds = %50
  %55 = load i8, ptr %11, align 1, !tbaa !15
  %56 = zext i8 %55 to i32
  switch i32 %56, label %79 [
    i32 0, label %57
    i32 1, label %60
    i32 2, label %68
    i32 3, label %76
  ]

57:                                               ; preds = %54
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %58, i32 0, i32 2
  store i8 1, ptr %59, align 4, !tbaa !16
  br label %79

60:                                               ; preds = %54
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 1) #4
  %62 = load i32, ptr %61, align 4, !tbaa !13
  %63 = icmp ugt i32 %62, 0
  %64 = zext i1 %63 to i64
  %65 = select i1 %63, i8 2, i8 4
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %66, i32 0, i32 2
  store i8 %65, ptr %67, align 4, !tbaa !16
  br label %79

68:                                               ; preds = %54
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %9, i64 noundef 3) #4
  %70 = load i32, ptr %69, align 4, !tbaa !13
  %71 = icmp ugt i32 %70, 0
  %72 = zext i1 %71 to i64
  %73 = select i1 %71, i8 8, i8 16
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %74, i32 0, i32 2
  store i8 %73, ptr %75, align 4, !tbaa !16
  br label %79

76:                                               ; preds = %54
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %77, i32 0, i32 2
  store i8 32, ptr %78, align 4, !tbaa !16
  br label %79

79:                                               ; preds = %76, %68, %60, %57, %54
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i8, ptr %11, align 1, !tbaa !15
  %82 = call i16 @_ZNK3Ani4DofT15TetGeomSparsity8beginPosEh(ptr noundef nonnull align 1 dereferenceable(4) %80, i8 noundef zeroext %81)
  store i16 %82, ptr %13, align 1
  %83 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %13, i32 0, i32 1
  %84 = load i8, ptr %83, align 1, !tbaa !18
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %85, i32 0, i32 3
  store i8 %84, ptr %86, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %87, i32 0, i32 1
  store i32 0, ptr %88, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = call i64 @_ZNK3Ani4DofT10LocalOrder12getGeomOrderEv(ptr noundef nonnull align 4 dereferenceable(12) %89)
  %91 = trunc i64 %90 to i48
  store i48 %91, ptr %15, align 4
  %92 = load i64, ptr %15, align 4
  %93 = load ptr, ptr %17, align 8, !tbaa !11
  %94 = getelementptr inbounds ptr, ptr %93, i64 10
  %95 = load ptr, ptr %94, align 8
  %96 = call i64 %95(ptr noundef nonnull align 8 dereferenceable(8) %17, i64 %92)
  %97 = trunc i64 %96 to i48
  store i48 %97, ptr %14, align 4
  %98 = getelementptr inbounds %"struct.std::pair.4", ptr %14, i32 0, i32 0
  %99 = load i32, ptr %98, align 4, !tbaa !22
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %100, i32 0, i32 0
  store i32 %99, ptr %101, align 4, !tbaa !25
  %102 = getelementptr inbounds %"struct.std::pair.4", ptr %14, i32 0, i32 1
  %103 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %102, i32 0, i32 0
  %104 = load i8, ptr %103, align 4, !tbaa !26
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %105, i32 0, i32 4
  store i8 %104, ptr %106, align 2, !tbaa !27
  %107 = getelementptr inbounds %"struct.std::pair.4", ptr %14, i32 0, i32 1
  %108 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %107, i32 0, i32 1
  %109 = load i8, ptr %108, align 1, !tbaa !28
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %110, i32 0, i32 5
  store i8 %109, ptr %111, align 1, !tbaa !29
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %116

112:                                              ; preds = %50, %44
  br label %113

113:                                              ; preds = %112
  %114 = load i8, ptr %11, align 1, !tbaa !15
  %115 = add i8 %114, 1
  store i8 %115, ptr %11, align 1, !tbaa !15
  br label %39, !llvm.loop !30

116:                                              ; preds = %79, %43
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  %117 = load i32, ptr %12, align 4
  switch i32 %117, label %123 [
    i32 2, label %118
  ]

118:                                              ; preds = %116
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load ptr, ptr %17, align 8, !tbaa !11
  %121 = getelementptr inbounds ptr, ptr %120, i64 20
  %122 = load ptr, ptr %121, align 8
  call void %122(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(12) %119)
  store i32 1, ptr %12, align 4
  br label %123

123:                                              ; preds = %118, %116
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK3Ani4DofT10LocalOrder12getGeomOrderEv(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 #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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !7, i64 8}
!17 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !14, i64 0, !14, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11}
!18 = !{!19, !7, i64 1}
!19 = !{!"_ZTSN3Ani4DofT15TetGeomSparsity3PosE", !7, i64 0, !7, i64 1}
!20 = !{!17, !7, i64 9}
!21 = !{!17, !14, i64 4}
!22 = !{!23, !14, i64 0}
!23 = !{!"_ZTSSt4pairIjN3Ani4DofT11LocSymOrderEE", !14, i64 0, !24, i64 4}
!24 = !{!"_ZTSN3Ani4DofT11LocSymOrderE", !7, i64 0, !7, i64 1}
!25 = !{!17, !14, i64 0}
!26 = !{!23, !7, i64 4}
!27 = !{!17, !7, i64 10}
!28 = !{!23, !7, i64 5}
!29 = !{!17, !7, i64 11}
!30 = distinct !{!30, !31}
!31 = !{!"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.std::array.2" = type { [6 x i32] }
%"struct.std::array.3" = type { [4 x i32] }

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4), i8 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i16 @_ZNK3Ani4DofT15TetGeomSparsity8beginPosEh(ptr noundef nonnull align 1 dereferenceable(4), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani4DofT10BaseDofMap19BeginByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 1 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, i1 noundef zeroext %3) unnamed_addr #2 align 2 {
  %5 = alloca %"struct.std::array.2", align 4
  %6 = alloca %"struct.std::array.3", align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 32
  %9 = load ptr, ptr %8, align 8
  call void %9(ptr dead_on_unwind nonnull writable sret(%"struct.std::array.2") align 4 %5, ptr noundef nonnull align 8 dereferenceable(8) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 0) #4
  %11 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %11, ptr %6, align 4, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %6, i64 4
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 1) #4
  %14 = load i32, ptr %13, align 4, !tbaa !8
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 2) #4
  %16 = load i32, ptr %15, align 4, !tbaa !8
  %17 = add i32 %16, %14
  store i32 %17, ptr %12, align 4, !tbaa !8
  %18 = getelementptr inbounds i8, ptr %6, i64 8
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 3) #4
  %20 = load i32, ptr %19, align 4, !tbaa !8
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 4) #4
  %22 = load i32, ptr %21, align 4, !tbaa !8
  %23 = add i32 %22, %20
  store i32 %23, ptr %18, align 4, !tbaa !8
  %24 = getelementptr inbounds i8, ptr %6, i64 12
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 5) #4
  %26 = load i32, ptr %25, align 4, !tbaa !8
  store i32 %26, ptr %24, align 4, !tbaa !8
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %6, i64 noundef 0) #4
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %.not = icmp eq i32 %28, 0
  br i1 %.not, label %51, label %29

29:                                               ; preds = %4
  %30 = call noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4) %1, i8 noundef zeroext 0)
  br i1 %30, label %51, label %39

31:                                               ; preds = %54
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 1) #4
  %33 = load i32, ptr %32, align 4, !tbaa !8
  %.not25 = icmp eq i32 %33, 0
  %34 = select i1 %.not25, i8 4, i8 2
  br label %39

35:                                               ; preds = %59
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24) %5, i64 noundef 3) #4
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %.not24 = icmp eq i32 %37, 0
  %38 = select i1 %.not24, i8 16, i8 8
  br label %39

39:                                               ; preds = %64, %29, %35, %31
  %.sink = phi i8 [ %38, %35 ], [ %34, %31 ], [ 1, %29 ], [ 32, %64 ]
  %.029.lcssa.wide34 = phi i8 [ 2, %35 ], [ 1, %31 ], [ 0, %29 ], [ 3, %64 ]
  %40 = getelementptr inbounds i8, ptr %2, i64 8
  store i8 %.sink, ptr %40, align 4, !tbaa !11
  %41 = call i16 @_ZNK3Ani4DofT15TetGeomSparsity8beginPosEh(ptr noundef nonnull align 1 dereferenceable(4) %1, i8 noundef zeroext %.029.lcssa.wide34)
  %.sroa.3.0.extract.shift = lshr i16 %41, 8
  %.sroa.3.0.extract.trunc = trunc nuw i16 %.sroa.3.0.extract.shift to i8
  %42 = getelementptr inbounds i8, ptr %2, i64 9
  store i8 %.sroa.3.0.extract.trunc, ptr %42, align 1, !tbaa !13
  %43 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 0, ptr %43, align 4, !tbaa !14
  %44 = call i64 @_ZNK3Ani4DofT10LocalOrder12getGeomOrderEv(ptr noundef nonnull align 4 dereferenceable(12) %2)
  %.sroa.0.0.insert.ext = and i64 %44, 281474976710655
  %45 = load ptr, ptr %0, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 80
  %47 = load ptr, ptr %46, align 8
  %48 = call i64 %47(ptr noundef nonnull align 8 dereferenceable(8) %0, i64 %.sroa.0.0.insert.ext)
  %.sroa.01.0.extract.trunc = trunc i64 %48 to i32
  store i32 %.sroa.01.0.extract.trunc, ptr %2, align 4, !tbaa !15
  %.sroa.01.4.extract.shift26 = lshr i64 %48, 32
  %.sroa.01.4.extract.trunc = trunc i64 %.sroa.01.4.extract.shift26 to i8
  %49 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %.sroa.01.4.extract.trunc, ptr %49, align 2, !tbaa !16
  %.sroa.01.5.extract.shift27 = lshr i64 %48, 40
  %.sroa.01.5.extract.trunc = trunc i64 %.sroa.01.5.extract.shift27 to i8
  %50 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %.sroa.01.5.extract.trunc, ptr %50, align 1, !tbaa !17
  br label %69

51:                                               ; preds = %4, %29
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %6, i64 noundef 1) #4
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %.not.1 = icmp eq i32 %53, 0
  br i1 %.not.1, label %56, label %54

54:                                               ; preds = %51
  %55 = call noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4) %1, i8 noundef zeroext 1)
  br i1 %55, label %56, label %31

56:                                               ; preds = %54, %51
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %6, i64 noundef 2) #4
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %.not.2 = icmp eq i32 %58, 0
  br i1 %.not.2, label %61, label %59

59:                                               ; preds = %56
  %60 = call noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4) %1, i8 noundef zeroext 2)
  br i1 %60, label %61, label %35

61:                                               ; preds = %59, %56
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm4EEixEm(ptr noundef nonnull align 4 dereferenceable(16) %6, i64 noundef 3) #4
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %.not.3 = icmp eq i32 %63, 0
  br i1 %.not.3, label %.critedge, label %64

64:                                               ; preds = %61
  %65 = call noundef zeroext i1 @_ZNK3Ani4DofT15TetGeomSparsity5emptyEh(ptr noundef nonnull align 1 dereferenceable(4) %1, i8 noundef zeroext 3)
  br i1 %65, label %.critedge, label %39

.critedge:                                        ; preds = %64, %61
  %66 = load ptr, ptr %0, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 160
  %68 = load ptr, ptr %67, align 8
  call void %68(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br label %69

69:                                               ; preds = %39, %.critedge
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIjLm6EEixEm(ptr noundef nonnull align 4 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK3Ani4DofT10LocalOrder12getGeomOrderEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 9, !10, i64 10, !10, i64 11}
!13 = !{!12, !10, i64 9}
!14 = !{!12, !9, i64 4}
!15 = !{!12, !9, i64 0}
!16 = !{!12, !10, i64 10}
!17 = !{!12, !10, i64 11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass