; 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.Ani::DofT::LocalOrder" = type { i32, i32, i8, i8, i8, i8 }
%"struct.Ani::DofT::LocSymOrder" = type { i8, i8 }
%"struct.Ani::DofT::TetGeomSparsity::Pos" = type { i8, i8 }
%"struct.Ani::DofT::TetGeomSparsity" = type { %"struct.std::array" }
%"struct.std::array" = type { [4 x i8] }
%"struct.Ani::DofT::UniteDofMap" = type { %"struct.Ani::DofT::BaseDofMap", %"struct.std::array.7", %"struct.std::array.7", %"struct.Ani::DofT::DofSymmetries" }
%"struct.Ani::DofT::BaseDofMap" = type { ptr }
%"struct.std::array.7" = type { [7 x i32] }
%"struct.Ani::DofT::DofSymmetries" = type { %"struct.std::array.6" }
%"struct.std::array.6" = type { [16 x i32] }

@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb = external hidden unnamed_addr constant [112 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 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: 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 void @_ZN3Ani4DofT15TetGeomSparsity3PosC2Ehh(ptr noundef nonnull align 1 dereferenceable(2), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3Ani4DofT15TetGeomSparsity3Pos7isValidEv(ptr noundef nonnull align 1 dereferenceable(2)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3Ani4DofT10BaseDofMap12isValidIndexENS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(8), i64, i32, i1 noundef zeroext) #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3Ani4DofT11GeomTypeDimEh(i8 noundef zeroext) #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3Ani4DofT13GeomTypeToNumEh(i8 noundef zeroext) #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 1 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, i1 noundef zeroext %3) unnamed_addr #3 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.Ani::DofT::LocalOrder", align 4
  %10 = alloca { i64, i32 }, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.Ani::DofT::LocSymOrder", align 1
  %13 = alloca i32, align 4
  %14 = alloca %"struct.Ani::DofT::LocSymOrder", align 1
  %15 = alloca %"struct.Ani::DofT::LocSymOrder", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"struct.Ani::DofT::TetGeomSparsity::Pos", align 1
  %18 = alloca %"struct.Ani::DofT::TetGeomSparsity::Pos", align 1
  %19 = alloca i32, align 4
  %20 = alloca %"struct.Ani::DofT::LocSymOrder", align 1
  %21 = alloca %"struct.Ani::DofT::TetGeomSparsity", align 1
  %22 = alloca i32, 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
  %23 = zext i1 %3 to i8
  store i8 %23, ptr %8, align 1, !tbaa !9
  %24 = load ptr, ptr %5, align 8
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %25, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %9, i64 12, i1 false)
  %26 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 0
  %27 = load i64, ptr %26, align 4
  %28 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 1
  %29 = load i32, ptr %28, align 4
  %30 = call noundef zeroext i1 @_ZNK3Ani4DofT10BaseDofMap12isValidIndexENS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(8) %24, i64 %27, i32 %29, i1 noundef zeroext false)
  br i1 %30, label %31, label %32

31:                                               ; preds = %4
  br label %32

32:                                               ; preds = %31, %4
  %33 = phi i1 [ false, %4 ], [ true, %31 ]
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  br label %37

35:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 363, ptr noundef @__PRETTY_FUNCTION__._ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb) #7
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %38, i32 0, i32 2
  %40 = load i8, ptr %39, align 4, !tbaa !15
  %41 = load ptr, ptr %24, align 8, !tbaa !17
  %42 = getelementptr inbounds ptr, ptr %41, i64 1
  %43 = load ptr, ptr %42, align 8
  %44 = call noundef i32 %43(ptr noundef nonnull align 8 dereferenceable(128) %24, i8 noundef zeroext %40)
  store i32 %44, ptr %11, align 4, !tbaa !12
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !19
  %48 = load i32, ptr %11, align 4, !tbaa !12
  %49 = sub i32 %48, 1
  %50 = icmp ult i32 %47, %49
  br i1 %50, label %51, label %76

51:                                               ; preds = %37
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !19
  %55 = add i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !19
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !20
  %59 = add i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #8
  %60 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 3
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %61, i32 0, i32 2
  %63 = load i8, ptr %62, align 4, !tbaa !15
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %60, i8 noundef zeroext %63, i32 noundef %66)
  store i16 %67, ptr %12, align 1
  %68 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %12, i32 0, i32 0
  %69 = load i8, ptr %68, align 1, !tbaa !21
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %70, i32 0, i32 4
  store i8 %69, ptr %71, align 2, !tbaa !23
  %72 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %12, i32 0, i32 1
  %73 = load i8, ptr %72, align 1, !tbaa !24
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %74, i32 0, i32 5
  store i8 %73, ptr %75, align 1, !tbaa !25
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #8
  br label %312

76:                                               ; preds = %37
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %77, i32 0, i32 2
  %79 = load i8, ptr %78, align 4, !tbaa !15
  %80 = zext i8 %79 to i32
  %81 = icmp eq i32 %80, 2
  br i1 %81, label %82, label %127

82:                                               ; preds = %76
  %83 = load ptr, ptr %24, align 8, !tbaa !17
  %84 = getelementptr inbounds ptr, ptr %83, i64 1
  %85 = load ptr, ptr %84, align 8
  %86 = call noundef i32 %85(ptr noundef nonnull align 8 dereferenceable(128) %24, i8 noundef zeroext 4)
  %87 = icmp ugt i32 %86, 0
  br i1 %87, label %88, label %127

88:                                               ; preds = %82
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %89, i32 0, i32 2
  store i8 4, ptr %90, align 4, !tbaa !15
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %91, i32 0, i32 1
  store i32 0, ptr %92, align 4, !tbaa !19
  %93 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 2
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %93, i64 noundef 2) #8
  %95 = load i32, ptr %94, align 4, !tbaa !12
  %96 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %96, i64 noundef 3) #8
  %98 = load i32, ptr %97, align 4, !tbaa !12
  %99 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %99, i64 noundef 2) #8
  %101 = load i32, ptr %100, align 4, !tbaa !12
  %102 = sub i32 %98, %101
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %103, i32 0, i32 3
  %105 = load i8, ptr %104, align 1, !tbaa !26
  %106 = zext i8 %105 to i32
  %107 = mul i32 %102, %106
  %108 = add i32 %95, %107
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %109, i32 0, i32 0
  store i32 %108, ptr %110, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #8
  %111 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 3
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %112, i32 0, i32 2
  %114 = load i8, ptr %113, align 4, !tbaa !15
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !19
  %118 = call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %111, i8 noundef zeroext %114, i32 noundef %117)
  store i16 %118, ptr %14, align 1
  %119 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %14, i32 0, i32 0
  %120 = load i8, ptr %119, align 1, !tbaa !21
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %121, i32 0, i32 4
  store i8 %120, ptr %122, align 2, !tbaa !23
  %123 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %14, i32 0, i32 1
  %124 = load i8, ptr %123, align 1, !tbaa !24
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %125, i32 0, i32 5
  store i8 %124, ptr %126, align 1, !tbaa !25
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #8
  br label %312

127:                                              ; preds = %82, %76
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %128, i32 0, i32 2
  %130 = load i8, ptr %129, align 4, !tbaa !15
  %131 = zext i8 %130 to i32
  %132 = icmp eq i32 %131, 8
  br i1 %132, label %133, label %178

133:                                              ; preds = %127
  %134 = load ptr, ptr %24, align 8, !tbaa !17
  %135 = getelementptr inbounds ptr, ptr %134, i64 1
  %136 = load ptr, ptr %135, align 8
  %137 = call noundef i32 %136(ptr noundef nonnull align 8 dereferenceable(128) %24, i8 noundef zeroext 16)
  %138 = icmp ugt i32 %137, 0
  br i1 %138, label %139, label %178

139:                                              ; preds = %133
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %140, i32 0, i32 2
  store i8 16, ptr %141, align 4, !tbaa !15
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %142, i32 0, i32 1
  store i32 0, ptr %143, align 4, !tbaa !19
  %144 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 2
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %144, i64 noundef 4) #8
  %146 = load i32, ptr %145, align 4, !tbaa !12
  %147 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %147, i64 noundef 5) #8
  %149 = load i32, ptr %148, align 4, !tbaa !12
  %150 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %151 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %150, i64 noundef 4) #8
  %152 = load i32, ptr %151, align 4, !tbaa !12
  %153 = sub i32 %149, %152
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %154, i32 0, i32 3
  %156 = load i8, ptr %155, align 1, !tbaa !26
  %157 = zext i8 %156 to i32
  %158 = mul i32 %153, %157
  %159 = add i32 %146, %158
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %160, i32 0, i32 0
  store i32 %159, ptr %161, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #8
  %162 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 3
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %163, i32 0, i32 2
  %165 = load i8, ptr %164, align 4, !tbaa !15
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %166, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !19
  %169 = call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %162, i8 noundef zeroext %165, i32 noundef %168)
  store i16 %169, ptr %15, align 1
  %170 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %15, i32 0, i32 0
  %171 = load i8, ptr %170, align 1, !tbaa !21
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %172, i32 0, i32 4
  store i8 %171, ptr %173, align 2, !tbaa !23
  %174 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %15, i32 0, i32 1
  %175 = load i8, ptr %174, align 1, !tbaa !24
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %176, i32 0, i32 5
  store i8 %175, ptr %177, align 1, !tbaa !25
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #8
  br label %312

178:                                              ; preds = %133, %127
  br label %179

179:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %180, i32 0, i32 2
  %182 = load i8, ptr %181, align 4, !tbaa !15
  %183 = call noundef i32 @_ZN3Ani4DofT11GeomTypeDimEh(i8 noundef zeroext %182)
  store i32 %183, ptr %16, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #8
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = load i32, ptr %16, align 4, !tbaa !12
  %186 = trunc i32 %185 to i8
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %187, i32 0, i32 3
  %189 = load i8, ptr %188, align 1, !tbaa !26
  call void @_ZN3Ani4DofT15TetGeomSparsity3PosC2Ehh(ptr noundef nonnull align 1 dereferenceable(2) %18, i8 noundef zeroext %186, i8 noundef zeroext %189)
  %190 = load i16, ptr %18, align 1
  %191 = call i16 @_ZNK3Ani4DofT15TetGeomSparsity7nextPosENS1_3PosE(ptr noundef nonnull align 1 dereferenceable(4) %184, i16 %190)
  store i16 %191, ptr %17, align 1
  %192 = call noundef zeroext i1 @_ZN3Ani4DofT15TetGeomSparsity3Pos7isValidEv(ptr noundef nonnull align 1 dereferenceable(2) %17)
  br i1 %192, label %198, label %193

193:                                              ; preds = %179
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = load ptr, ptr %24, align 8, !tbaa !17
  %196 = getelementptr inbounds ptr, ptr %195, i64 20
  %197 = load ptr, ptr %196, align 8
  call void %197(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(12) %194)
  store i32 1, ptr %13, align 4
  br label %311

198:                                              ; preds = %179
  %199 = load i32, ptr %16, align 4, !tbaa !12
  %200 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %17, i32 0, i32 0
  %201 = load i8, ptr %200, align 1, !tbaa !27
  %202 = zext i8 %201 to i32
  %203 = icmp eq i32 %199, %202
  br i1 %203, label %204, label %287

204:                                              ; preds = %198
  %205 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %17, i32 0, i32 1
  %206 = load i8, ptr %205, align 1, !tbaa !29
  %207 = load ptr, ptr %7, align 8, !tbaa !5
  %208 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %207, i32 0, i32 3
  store i8 %206, ptr %208, align 1, !tbaa !26
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %209, i32 0, i32 1
  store i32 0, ptr %210, align 4, !tbaa !19
  %211 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %17, i32 0, i32 0
  %212 = load i8, ptr %211, align 1, !tbaa !27
  %213 = zext i8 %212 to i32
  %214 = icmp eq i32 %213, 1
  br i1 %214, label %215, label %225

215:                                              ; preds = %204
  %216 = load ptr, ptr %24, align 8, !tbaa !17
  %217 = getelementptr inbounds ptr, ptr %216, i64 1
  %218 = load ptr, ptr %217, align 8
  %219 = call noundef i32 %218(ptr noundef nonnull align 8 dereferenceable(128) %24, i8 noundef zeroext 2)
  %220 = icmp ugt i32 %219, 0
  br i1 %220, label %221, label %224

221:                                              ; preds = %215
  %222 = load ptr, ptr %7, align 8, !tbaa !5
  %223 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %222, i32 0, i32 2
  store i8 2, ptr %223, align 4, !tbaa !15
  br label %224

224:                                              ; preds = %221, %215
  br label %241

225:                                              ; preds = %204
  %226 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %17, i32 0, i32 0
  %227 = load i8, ptr %226, align 1, !tbaa !27
  %228 = zext i8 %227 to i32
  %229 = icmp eq i32 %228, 2
  br i1 %229, label %230, label %240

230:                                              ; preds = %225
  %231 = load ptr, ptr %24, align 8, !tbaa !17
  %232 = getelementptr inbounds ptr, ptr %231, i64 1
  %233 = load ptr, ptr %232, align 8
  %234 = call noundef i32 %233(ptr noundef nonnull align 8 dereferenceable(128) %24, i8 noundef zeroext 8)
  %235 = icmp ugt i32 %234, 0
  br i1 %235, label %236, label %239

236:                                              ; preds = %230
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %237, i32 0, i32 2
  store i8 8, ptr %238, align 4, !tbaa !15
  br label %239

239:                                              ; preds = %236, %230
  br label %240

240:                                              ; preds = %239, %225
  br label %241

241:                                              ; preds = %240, %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %242 = load ptr, ptr %7, align 8, !tbaa !5
  %243 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %242, i32 0, i32 2
  %244 = load i8, ptr %243, align 4, !tbaa !15
  %245 = call noundef i32 @_ZN3Ani4DofT13GeomTypeToNumEh(i8 noundef zeroext %244)
  store i32 %245, ptr %19, align 4, !tbaa !12
  %246 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 2
  %247 = load i32, ptr %19, align 4, !tbaa !12
  %248 = sext i32 %247 to i64
  %249 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %246, i64 noundef %248) #8
  %250 = load i32, ptr %249, align 4, !tbaa !12
  %251 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %252 = load i32, ptr %19, align 4, !tbaa !12
  %253 = add nsw i32 %252, 1
  %254 = sext i32 %253 to i64
  %255 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %251, i64 noundef %254) #8
  %256 = load i32, ptr %255, align 4, !tbaa !12
  %257 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 1
  %258 = load i32, ptr %19, align 4, !tbaa !12
  %259 = sext i32 %258 to i64
  %260 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %257, i64 noundef %259) #8
  %261 = load i32, ptr %260, align 4, !tbaa !12
  %262 = sub i32 %256, %261
  %263 = load ptr, ptr %7, align 8, !tbaa !5
  %264 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %263, i32 0, i32 3
  %265 = load i8, ptr %264, align 1, !tbaa !26
  %266 = zext i8 %265 to i32
  %267 = mul i32 %262, %266
  %268 = add i32 %250, %267
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  %270 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %269, i32 0, i32 0
  store i32 %268, ptr %270, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #8
  %271 = getelementptr inbounds %"struct.Ani::DofT::UniteDofMap", ptr %24, i32 0, i32 3
  %272 = load ptr, ptr %7, align 8, !tbaa !5
  %273 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %272, i32 0, i32 2
  %274 = load i8, ptr %273, align 4, !tbaa !15
  %275 = load ptr, ptr %7, align 8, !tbaa !5
  %276 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %275, i32 0, i32 1
  %277 = load i32, ptr %276, align 4, !tbaa !19
  %278 = call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %271, i8 noundef zeroext %274, i32 noundef %277)
  store i16 %278, ptr %20, align 1
  %279 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %20, i32 0, i32 0
  %280 = load i8, ptr %279, align 1, !tbaa !21
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %281, i32 0, i32 4
  store i8 %280, ptr %282, align 2, !tbaa !23
  %283 = getelementptr inbounds %"struct.Ani::DofT::LocSymOrder", ptr %20, i32 0, i32 1
  %284 = load i8, ptr %283, align 1, !tbaa !24
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %285, i32 0, i32 5
  store i8 %284, ptr %286, align 1, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %310

287:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %21, ptr align 1 %288, i64 4, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !12
  br label %289

289:                                              ; preds = %300, %287
  %290 = load i32, ptr %22, align 4, !tbaa !12
  %291 = getelementptr inbounds %"struct.Ani::DofT::TetGeomSparsity::Pos", ptr %17, i32 0, i32 0
  %292 = load i8, ptr %291, align 1, !tbaa !27
  %293 = zext i8 %292 to i32
  %294 = icmp slt i32 %290, %293
  br i1 %294, label %296, label %295

295:                                              ; preds = %289
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %303

296:                                              ; preds = %289
  %297 = load i32, ptr %22, align 4, !tbaa !12
  %298 = trunc i32 %297 to i8
  %299 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN3Ani4DofT15TetGeomSparsity5unsetEh(ptr noundef nonnull align 1 dereferenceable(4) %21, i8 noundef zeroext %298)
  br label %300

300:                                              ; preds = %296
  %301 = load i32, ptr %22, align 4, !tbaa !12
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %22, align 4, !tbaa !12
  br label %289, !llvm.loop !31

303:                                              ; preds = %295
  %304 = load ptr, ptr %7, align 8, !tbaa !5
  %305 = load i8, ptr %8, align 1, !tbaa !9, !range !33, !noundef !34
  %306 = trunc i8 %305 to i1
  %307 = load ptr, ptr %24, align 8, !tbaa !17
  %308 = getelementptr inbounds ptr, ptr %307, i64 19
  %309 = load ptr, ptr %308, align 8
  call void %309(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 1 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(12) %304, i1 noundef zeroext %306)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %310

310:                                              ; preds = %303, %241
  store i32 1, ptr %13, align 4
  br label %311

311:                                              ; preds = %310, %193
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %312

312:                                              ; preds = %311, %139, %88, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64), i8 noundef zeroext, i32 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #3 = { 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 = { 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 #5 = { noreturn 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 = { inlinehint 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 #7 = { noreturn nounwind }
attributes #8 = { 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 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 1, !14, i64 9, i64 1, !14, i64 10, i64 1, !14, i64 11, i64 1, !14}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !7, i64 8}
!16 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !13, i64 0, !13, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!16, !13, i64 4}
!20 = !{!16, !13, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"_ZTSN3Ani4DofT11LocSymOrderE", !7, i64 0, !7, i64 1}
!23 = !{!16, !7, i64 10}
!24 = !{!22, !7, i64 1}
!25 = !{!16, !7, i64 11}
!26 = !{!16, !7, i64 9}
!27 = !{!28, !7, i64 0}
!28 = !{!"_ZTSN3Ani4DofT15TetGeomSparsity3PosE", !7, i64 0, !7, i64 1}
!29 = !{!28, !7, i64 1}
!30 = !{i64 0, i64 4, !14}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{i8 0, i8 2}
!34 = !{}


; 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.Ani::DofT::TetGeomSparsity::Pos" = type { i8, i8 }
%"struct.Ani::DofT::TetGeomSparsity" = type { %"struct.std::array" }
%"struct.std::array" = type { [4 x i8] }

@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb = external hidden unnamed_addr constant [112 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 nounwind uwtable
declare dso_local void @_ZN3Ani4DofT15TetGeomSparsity3PosC2Ehh(ptr noundef nonnull align 1 dereferenceable(2), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3Ani4DofT15TetGeomSparsity3Pos7isValidEv(ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #1 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3Ani4DofT11GeomTypeDimEh(i8 noundef zeroext) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3Ani4DofT13GeomTypeToNumEh(i8 noundef zeroext) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(128) %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.Ani::DofT::TetGeomSparsity::Pos", align 2
  %6 = alloca %"struct.Ani::DofT::TetGeomSparsity::Pos", align 2
  %7 = alloca %"struct.Ani::DofT::TetGeomSparsity", align 4
  %.sroa.016.0.copyload = load i64, ptr %2, align 4
  %.sroa.217.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  %.sroa.217.0.copyload = load i32, ptr %.sroa.217.0..sroa_idx, align 4
  %8 = tail call noundef zeroext i1 @_ZNK3Ani4DofT10BaseDofMap12isValidIndexENS0_10LocalOrderEb(ptr noundef nonnull align 8 dereferenceable(8) %0, i64 %.sroa.016.0.copyload, i32 %.sroa.217.0.copyload, i1 noundef zeroext false)
  br i1 %8, label %10, label %9

9:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 363, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3Ani4DofT11UniteDofMap23IncrementByGeomSparsityERKNS0_15TetGeomSparsityERNS0_10LocalOrderEb) #6
  unreachable

10:                                               ; preds = %4
  %11 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %12 = load ptr, ptr %0, align 8, !tbaa !10
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef i32 %14(ptr noundef nonnull align 8 dereferenceable(128) %0, i8 noundef zeroext %11)
  %16 = getelementptr inbounds i8, ptr %2, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !12
  %18 = add i32 %15, -1
  %19 = icmp ult i32 %17, %18
  br i1 %19, label %20, label %29

20:                                               ; preds = %10
  %21 = add nuw i32 %17, 1
  store i32 %21, ptr %16, align 4, !tbaa !12
  %22 = load i32, ptr %2, align 4, !tbaa !13
  %23 = add i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %0, i64 64
  %25 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %26 = tail call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %24, i8 noundef zeroext %25, i32 noundef %21)
  %.sroa.012.0.extract.trunc = trunc i16 %26 to i8
  %.sroa.413.0.extract.shift = lshr i16 %26, 8
  %.sroa.413.0.extract.trunc = trunc nuw i16 %.sroa.413.0.extract.shift to i8
  %27 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %.sroa.012.0.extract.trunc, ptr %27, align 2, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %.sroa.413.0.extract.trunc, ptr %28, align 1, !tbaa !15
  br label %154

29:                                               ; preds = %10
  %30 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %31 = icmp eq i8 %30, 2
  br i1 %31, label %32, label %58

32:                                               ; preds = %29
  %33 = load ptr, ptr %0, align 8, !tbaa !10
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8
  %36 = tail call noundef i32 %35(ptr noundef nonnull align 8 dereferenceable(128) %0, i8 noundef zeroext 4)
  %.not = icmp eq i32 %36, 0
  br i1 %.not, label %thread-pre-split, label %37

37:                                               ; preds = %32
  store i8 4, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %0, i64 36
  %39 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %38, i64 noundef 2) #7
  %40 = load i32, ptr %39, align 4, !tbaa !16
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %41, i64 noundef 3) #7
  %43 = load i32, ptr %42, align 4, !tbaa !16
  %44 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %41, i64 noundef 2) #7
  %45 = load i32, ptr %44, align 4, !tbaa !16
  %46 = sub i32 %43, %45
  %47 = getelementptr inbounds i8, ptr %2, i64 9
  %48 = load i8, ptr %47, align 1, !tbaa !17
  %49 = zext i8 %48 to i32
  %50 = mul i32 %46, %49
  %51 = add i32 %50, %40
  store i32 %51, ptr %2, align 4, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %0, i64 64
  %53 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %54 = load i32, ptr %16, align 4, !tbaa !12
  %55 = tail call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %52, i8 noundef zeroext %53, i32 noundef %54)
  %.sroa.010.0.extract.trunc = trunc i16 %55 to i8
  %.sroa.411.0.extract.shift = lshr i16 %55, 8
  %.sroa.411.0.extract.trunc = trunc nuw i16 %.sroa.411.0.extract.shift to i8
  %56 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %.sroa.010.0.extract.trunc, ptr %56, align 2, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %.sroa.411.0.extract.trunc, ptr %57, align 1, !tbaa !15
  br label %154

thread-pre-split:                                 ; preds = %32
  %.pr = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %thread-pre-split, %29
  %59 = phi i8 [ %.pr, %thread-pre-split ], [ %30, %29 ]
  %60 = icmp eq i8 %59, 8
  br i1 %60, label %61, label %87

61:                                               ; preds = %58
  %62 = load ptr, ptr %0, align 8, !tbaa !10
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load ptr, ptr %63, align 8
  %65 = tail call noundef i32 %64(ptr noundef nonnull align 8 dereferenceable(128) %0, i8 noundef zeroext 16)
  %.not65 = icmp eq i32 %65, 0
  br i1 %.not65, label %._crit_edge70, label %66

._crit_edge70:                                    ; preds = %61
  %.pre = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  br label %87

66:                                               ; preds = %61
  store i8 16, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %0, i64 36
  %68 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %67, i64 noundef 4) #7
  %69 = load i32, ptr %68, align 4, !tbaa !16
  %70 = getelementptr inbounds i8, ptr %0, i64 8
  %71 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %70, i64 noundef 5) #7
  %72 = load i32, ptr %71, align 4, !tbaa !16
  %73 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %70, i64 noundef 4) #7
  %74 = load i32, ptr %73, align 4, !tbaa !16
  %75 = sub i32 %72, %74
  %76 = getelementptr inbounds i8, ptr %2, i64 9
  %77 = load i8, ptr %76, align 1, !tbaa !17
  %78 = zext i8 %77 to i32
  %79 = mul i32 %75, %78
  %80 = add i32 %79, %69
  store i32 %80, ptr %2, align 4, !tbaa !13
  %81 = getelementptr inbounds i8, ptr %0, i64 64
  %82 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %83 = load i32, ptr %16, align 4, !tbaa !12
  %84 = tail call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %81, i8 noundef zeroext %82, i32 noundef %83)
  %.sroa.08.0.extract.trunc = trunc i16 %84 to i8
  %.sroa.49.0.extract.shift = lshr i16 %84, 8
  %.sroa.49.0.extract.trunc = trunc nuw i16 %.sroa.49.0.extract.shift to i8
  %85 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %.sroa.08.0.extract.trunc, ptr %85, align 2, !tbaa !14
  %86 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %.sroa.49.0.extract.trunc, ptr %86, align 1, !tbaa !15
  br label %154

87:                                               ; preds = %._crit_edge70, %58
  %88 = phi i8 [ %.pre, %._crit_edge70 ], [ %59, %58 ]
  %89 = tail call noundef i32 @_ZN3Ani4DofT11GeomTypeDimEh(i8 noundef zeroext %88)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #7
  %90 = trunc i32 %89 to i8
  %91 = getelementptr inbounds i8, ptr %2, i64 9
  %92 = load i8, ptr %91, align 1, !tbaa !17
  call void @_ZN3Ani4DofT15TetGeomSparsity3PosC2Ehh(ptr noundef nonnull align 1 dereferenceable(2) %6, i8 noundef zeroext %90, i8 noundef zeroext %92)
  %93 = load i16, ptr %6, align 2
  %94 = call i16 @_ZNK3Ani4DofT15TetGeomSparsity7nextPosENS1_3PosE(ptr noundef nonnull align 1 dereferenceable(4) %1, i16 %93)
  store i16 %94, ptr %5, align 2
  %95 = call noundef zeroext i1 @_ZN3Ani4DofT15TetGeomSparsity3Pos7isValidEv(ptr noundef nonnull align 1 dereferenceable(2) %5)
  br i1 %95, label %100, label %96

96:                                               ; preds = %87
  %97 = load ptr, ptr %0, align 8, !tbaa !10
  %98 = getelementptr inbounds i8, ptr %97, i64 160
  %99 = load ptr, ptr %98, align 8
  call void %99(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br label %153

100:                                              ; preds = %87
  %101 = load i8, ptr %5, align 2, !tbaa !18
  %102 = zext i8 %101 to i32
  %103 = icmp eq i32 %89, %102
  br i1 %103, label %104, label %142

104:                                              ; preds = %100
  %105 = getelementptr inbounds i8, ptr %5, i64 1
  %106 = load i8, ptr %105, align 1, !tbaa !20
  store i8 %106, ptr %91, align 1, !tbaa !17
  store i32 0, ptr %16, align 4, !tbaa !12
  switch i8 %101, label %117 [
    i8 1, label %107
    i8 2, label %112
  ]

107:                                              ; preds = %104
  %108 = load ptr, ptr %0, align 8, !tbaa !10
  %109 = getelementptr inbounds i8, ptr %108, i64 8
  %110 = load ptr, ptr %109, align 8
  %111 = call noundef i32 %110(ptr noundef nonnull align 8 dereferenceable(128) %0, i8 noundef zeroext 2)
  %.not67 = icmp eq i32 %111, 0
  br i1 %.not67, label %117, label %.sink.split

112:                                              ; preds = %104
  %113 = load ptr, ptr %0, align 8, !tbaa !10
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  %115 = load ptr, ptr %114, align 8
  %116 = call noundef i32 %115(ptr noundef nonnull align 8 dereferenceable(128) %0, i8 noundef zeroext 8)
  %.not66 = icmp eq i32 %116, 0
  br i1 %.not66, label %117, label %.sink.split

.sink.split:                                      ; preds = %112, %107
  %.sink = phi i8 [ 2, %107 ], [ 8, %112 ]
  store i8 %.sink, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %.sink.split, %104, %112, %107
  %118 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %119 = call noundef i32 @_ZN3Ani4DofT13GeomTypeToNumEh(i8 noundef zeroext %118)
  %120 = getelementptr inbounds i8, ptr %0, i64 36
  %121 = sext i32 %119 to i64
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %120, i64 noundef %121) #7
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = getelementptr inbounds i8, ptr %0, i64 8
  %125 = add nsw i32 %119, 1
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %124, i64 noundef %126) #7
  %128 = load i32, ptr %127, align 4, !tbaa !16
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm7EEixEm(ptr noundef nonnull align 4 dereferenceable(28) %124, i64 noundef %121) #7
  %130 = load i32, ptr %129, align 4, !tbaa !16
  %131 = sub i32 %128, %130
  %132 = load i8, ptr %91, align 1, !tbaa !17
  %133 = zext i8 %132 to i32
  %134 = mul i32 %131, %133
  %135 = add i32 %134, %123
  store i32 %135, ptr %2, align 4, !tbaa !13
  %136 = getelementptr inbounds i8, ptr %0, i64 64
  %137 = load i8, ptr %.sroa.217.0..sroa_idx, align 4, !tbaa !5
  %138 = load i32, ptr %16, align 4, !tbaa !12
  %139 = call i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64) %136, i8 noundef zeroext %137, i32 noundef %138)
  %.sroa.0.0.extract.trunc = trunc i16 %139 to i8
  %.sroa.4.0.extract.shift = lshr i16 %139, 8
  %.sroa.4.0.extract.trunc = trunc nuw i16 %.sroa.4.0.extract.shift to i8
  %140 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %.sroa.0.0.extract.trunc, ptr %140, align 2, !tbaa !14
  %141 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %.sroa.4.0.extract.trunc, ptr %141, align 1, !tbaa !15
  br label %153

142:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %143 = load i32, ptr %1, align 1, !tbaa !21
  store i32 %143, ptr %7, align 4, !tbaa !21
  %.not69 = icmp eq i8 %101, 0
  br i1 %.not69, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %142
  %144 = load ptr, ptr %0, align 8, !tbaa !10
  %145 = getelementptr inbounds i8, ptr %144, i64 152
  %146 = load ptr, ptr %145, align 8
  call void %146(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 1 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(12) %2, i1 noundef zeroext %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %153

.lr.ph:                                           ; preds = %142, %.lr.ph
  %.068 = phi i32 [ %149, %.lr.ph ], [ 0, %142 ]
  %147 = trunc i32 %.068 to i8
  %148 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN3Ani4DofT15TetGeomSparsity5unsetEh(ptr noundef nonnull align 1 dereferenceable(4) %7, i8 noundef zeroext %147)
  %149 = add nuw nsw i32 %.068, 1
  %150 = load i8, ptr %5, align 2, !tbaa !18
  %151 = zext i8 %150 to i32
  %152 = icmp ult i32 %149, %151
  br i1 %152, label %.lr.ph, label %._crit_edge, !llvm.loop !22

153:                                              ; preds = %117, %._crit_edge, %96
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #7
  br label %154

154:                                              ; preds = %153, %66, %37, %20
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i16 @_ZNK3Ani4DofT13DofSymmetries14GetLocSymOrderEhj(ptr noundef nonnull align 4 dereferenceable(64), i8 noundef zeroext, i32 noundef) 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 = { noreturn 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 #5 = { inlinehint 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 #6 = { noreturn nounwind }
attributes #7 = { 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, !8, i64 8}
!6 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"vtable pointer", !9, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !8, i64 10}
!15 = !{!6, !8, i64 11}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !8, i64 9}
!18 = !{!19, !8, i64 0}
!19 = !{!"_ZTSN3Ani4DofT15TetGeomSparsity3PosE", !8, i64 0, !8, i64 1}
!20 = !{!19, !8, i64 1}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass