; LLVM IR from achilles288/robot-monitor-graphics :: src/base/mesh_indices.ll (ZN3rmg4Mesh13buildIndices2Ev)

; 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"

%class.anon.15 = type { i8 }
%class.anon.17 = type { i8 }
%"class.std::unordered_map.19" = type { %"class.std::_Hashtable.20" }
%"class.std::_Hashtable.20" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::allocator.35" = type { i8 }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.38", %"struct.std::_Head_base.41" }
%"struct.std::_Tuple_impl.38" = type { %"struct.std::_Tuple_impl.39", %"struct.std::_Head_base.40" }
%"struct.std::_Tuple_impl.39" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %"struct.rmg::Vec2" }
%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { float, float }
%"struct.std::_Head_base.40" = type { %"struct.rmg::Vec3" }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.std::_Head_base.41" = type { %"struct.rmg::Vec3" }
%"struct.std::__detail::_Node_iterator.42" = type { %"struct.std::__detail::_Node_iterator_base.43" }
%"struct.std::__detail::_Node_iterator_base.43" = type { ptr }
%"struct.std::pair.44" = type { %"class.std::tuple", i32 }
%"struct.std::pair.46" = type <{ %"struct.std::__detail::_Node_iterator.42", i8, [7 x i8] }>
%"class.rmg::Mesh" = type <{ ptr, ptr, ptr, ptr, i32, [4 x i8], ptr, i32, [4 x i8] }>
%"struct.std::pair.49" = type { %"class.std::tuple", i32 }

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg4Mesh13buildIndices2Ev(ptr noundef nonnull align 8 dereferenceable(52) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.anon.15, align 1
  %4 = alloca %class.anon.17, align 1
  %5 = alloca %"class.std::unordered_map.19", align 8
  %6 = alloca %"class.std::allocator.35", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::tuple", align 4
  %14 = alloca %"struct.std::__detail::_Node_iterator.42", align 8
  %15 = alloca %"struct.std::__detail::_Node_iterator.42", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.44", align 4
  %18 = alloca %"struct.std::pair.46", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %19 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  call void @_ZNSaISt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEEC2EmRKS6_RKS7_RKSB_"(ptr noundef nonnull align 8 dereferenceable(56) %5, i64 noundef 65536, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %20 unwind label %51

20:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  %21 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 7
  store i32 %22, ptr %23, align 8, !tbaa !12
  %24 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 7
  %25 = load i32, ptr %24, align 8, !tbaa !12
  %26 = zext i32 %25 to i64
  %27 = mul i64 4, %26
  %28 = call noalias ptr @malloc(i64 noundef %27) #8
  %29 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 6
  store ptr %28, ptr %29, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %30 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = mul i64 12, %32
  %34 = call noalias ptr @malloc(i64 noundef %33) #8
  store ptr %34, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %35 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = mul i64 12, %37
  %39 = call noalias ptr @malloc(i64 noundef %38) #8
  store ptr %39, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %40 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = mul i64 8, %42
  %44 = call noalias ptr @malloc(i64 noundef %43) #8
  store ptr %44, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %45

45:                                               ; preds = %145, %20
  %46 = load i32, ptr %12, align 4, !tbaa !14
  %47 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = icmp ult i32 %46, %48
  br i1 %49, label %55, label %50

50:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %150

51:                                               ; preds = %1
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  call void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %196

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  %56 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = load i32, ptr %12, align 4, !tbaa !14
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds %"struct.rmg::Vec3", ptr %57, i64 %59
  %61 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load i32, ptr %12, align 4, !tbaa !14
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds %"struct.rmg::Vec3", ptr %62, i64 %64
  %66 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !17
  %68 = load i32, ptr %12, align 4, !tbaa !14
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds %"struct.rmg::Vec2", ptr %67, i64 %69
  invoke void @_ZSt10make_tupleIJRN3rmg4Vec3ES2_RNS0_4Vec2EEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS8_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %60, ptr noundef nonnull align 4 dereferenceable(12) %65, ptr noundef nonnull align 4 dereferenceable(8) %70)
          to label %71 unwind label %123

71:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %72 = invoke ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4findERS9_"(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 4 dereferenceable(32) %13)
          to label %73 unwind label %127

73:                                               ; preds = %71
  %74 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.42", ptr %14, i32 0, i32 0
  %75 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.43", ptr %74, i32 0, i32 0
  store ptr %72, ptr %75, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %76 = call ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %77 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.42", ptr %15, i32 0, i32 0
  %78 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.43", ptr %77, i32 0, i32 0
  store ptr %76, ptr %78, align 8
  %79 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb1EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br i1 %79, label %80, label %135

80:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %81 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %16, align 4, !tbaa !14
  %83 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !15
  %85 = load i32, ptr %12, align 4, !tbaa !14
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds %"struct.rmg::Vec3", ptr %84, i64 %86
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = load i32, ptr %16, align 4, !tbaa !14
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds %"struct.rmg::Vec3", ptr %88, i64 %90
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %91, ptr align 4 %87, i64 12, i1 false), !tbaa.struct !18
  %92 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !16
  %94 = load i32, ptr %12, align 4, !tbaa !14
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds %"struct.rmg::Vec3", ptr %93, i64 %95
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i32, ptr %16, align 4, !tbaa !14
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds %"struct.rmg::Vec3", ptr %97, i64 %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 4 %96, i64 12, i1 false), !tbaa.struct !18
  %101 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 3
  %102 = load ptr, ptr %101, align 8, !tbaa !17
  %103 = load i32, ptr %12, align 4, !tbaa !14
  %104 = zext i32 %103 to i64
  %105 = getelementptr inbounds %"struct.rmg::Vec2", ptr %102, i64 %104
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load i32, ptr %16, align 4, !tbaa !14
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds %"struct.rmg::Vec2", ptr %106, i64 %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %109, ptr align 4 %105, i64 8, i1 false), !tbaa.struct !20
  %110 = load i32, ptr %16, align 4, !tbaa !14
  %111 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 6
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = load i32, ptr %12, align 4, !tbaa !14
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  store i32 %110, ptr %115, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 36, ptr %17) #7
  invoke void @_ZSt9make_pairIRSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEERjESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind writable sret(%"struct.std::pair.44") align 4 %17, ptr noundef nonnull align 4 dereferenceable(32) %13, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %116 unwind label %131

116:                                              ; preds = %80
  %117 = invoke { ptr, i8 } @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE6insertIRS8_IS4_jEEENSt9enable_ifIXsr16is_constructibleISA_OT_EE5valueES8_INSt8__detail14_Node_iteratorISA_Lb0ELb1EEEbEE4typeESI_"(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 4 dereferenceable(36) %17)
          to label %118 unwind label %131

118:                                              ; preds = %116
  %119 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %120 = extractvalue { ptr, i8 } %117, 0
  store ptr %120, ptr %119, align 8
  %121 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %122 = extractvalue { ptr, i8 } %117, 1
  store i8 %122, ptr %121, align 8
  call void @llvm.lifetime.end.p0(i64 36, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %144

123:                                              ; preds = %55
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %7, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %8, align 4
  br label %149

127:                                              ; preds = %71
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %7, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %8, align 4
  br label %148

131:                                              ; preds = %116, %80
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %7, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 36, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %148

135:                                              ; preds = %73
  %136 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %137 = getelementptr inbounds %"struct.std::pair.49", ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !21
  %139 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 6
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = load i32, ptr %12, align 4, !tbaa !14
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %140, i64 %142
  store i32 %138, ptr %143, align 4, !tbaa !14
  br label %144

144:                                              ; preds = %135, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %12, align 4, !tbaa !14
  %147 = add i32 %146, 1
  store i32 %147, ptr %12, align 4, !tbaa !14
  br label %45, !llvm.loop !32

148:                                              ; preds = %131, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %149

149:                                              ; preds = %148, %123
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  br label %196

150:                                              ; preds = %50
  %151 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %152 = trunc i64 %151 to i32
  %153 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  store i32 %152, ptr %153, align 8, !tbaa !9
  %154 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !15
  call void @free(ptr noundef %155) #7
  %156 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !16
  call void @free(ptr noundef %157) #7
  %158 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !17
  call void @free(ptr noundef %159) #7
  %160 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %161 = load i32, ptr %160, align 8, !tbaa !9
  %162 = zext i32 %161 to i64
  %163 = mul i64 12, %162
  %164 = call noalias ptr @malloc(i64 noundef %163) #8
  %165 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 1
  store ptr %164, ptr %165, align 8, !tbaa !15
  %166 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %167 = load i32, ptr %166, align 8, !tbaa !9
  %168 = zext i32 %167 to i64
  %169 = mul i64 12, %168
  %170 = call noalias ptr @malloc(i64 noundef %169) #8
  %171 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 2
  store ptr %170, ptr %171, align 8, !tbaa !16
  %172 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 4
  %173 = load i32, ptr %172, align 8, !tbaa !9
  %174 = zext i32 %173 to i64
  %175 = mul i64 8, %174
  %176 = call noalias ptr @malloc(i64 noundef %175) #8
  %177 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 3
  store ptr %176, ptr %177, align 8, !tbaa !17
  %178 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %182 = mul i64 12, %181
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %179, ptr align 4 %180, i64 %182, i1 false)
  %183 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 2
  %184 = load ptr, ptr %183, align 8, !tbaa !16
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %187 = mul i64 12, %186
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %184, ptr align 4 %185, i64 %187, i1 false)
  %188 = getelementptr inbounds %"class.rmg::Mesh", ptr %19, i32 0, i32 3
  %189 = load ptr, ptr %188, align 8, !tbaa !17
  %190 = load ptr, ptr %11, align 8, !tbaa !5
  %191 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %192 = mul i64 8, %191
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %189, ptr align 4 %190, i64 %192, i1 false)
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %193) #7
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %194) #7
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %195) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  ret void

196:                                              ; preds = %149, %51
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %7, align 8
  %199 = load i32, ptr %8, align 4
  %200 = insertvalue { ptr, i32 } poison, ptr %198, 0
  %201 = insertvalue { ptr, i32 } %200, i32 %199, 1
  resume { ptr, i32 } %201
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEEC2EmRKS6_RKS7_RKSB_"(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJRN3rmg4Vec3ES2_RNS0_4Vec2EEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS8_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4findERS9_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb1EEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEERjESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.44") align 4, ptr noundef nonnull align 4 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE6insertIRS8_IS4_jEEENSt9enable_ifIXsr16is_constructibleISA_OT_EE5valueES8_INSt8__detail14_Node_iteratorISA_Lb0ELb1EEEbEE4typeESI_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(36)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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 = { 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 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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, !11, i64 32}
!10 = !{!"_ZTSN3rmg4MeshE", !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !11, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 48}
!13 = !{!10, !6, i64 40}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{!10, !6, i64 16}
!17 = !{!10, !6, i64 24}
!18 = !{i64 0, i64 12, !19}
!19 = !{!7, !7, i64 0}
!20 = !{i64 0, i64 8, !19}
!21 = !{!22, !11, i64 32}
!22 = !{!"_ZTSSt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjE", !23, i64 0, !11, i64 32}
!23 = !{!"_ZTSSt5tupleIJN3rmg4Vec3ES1_NS0_4Vec2EEE", !24, i64 0}
!24 = !{!"_ZTSSt11_Tuple_implILm0EJN3rmg4Vec3ES1_NS0_4Vec2EEE", !25, i64 0, !31, i64 20}
!25 = !{!"_ZTSSt11_Tuple_implILm1EJN3rmg4Vec3ENS0_4Vec2EEE", !26, i64 0, !29, i64 8}
!26 = !{!"_ZTSSt11_Tuple_implILm2EJN3rmg4Vec2EEE", !27, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm2EN3rmg4Vec2ELb0EE", !28, i64 0}
!28 = !{!"_ZTSN3rmg4Vec2E", !7, i64 0}
!29 = !{!"_ZTSSt10_Head_baseILm1EN3rmg4Vec3ELb0EE", !30, i64 0}
!30 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!31 = !{!"_ZTSSt10_Head_baseILm0EN3rmg4Vec3ELb0EE", !30, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"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"

%class.anon.15 = type { i8 }
%class.anon.17 = type { i8 }
%"class.std::unordered_map.19" = type { %"class.std::_Hashtable.20" }
%"class.std::_Hashtable.20" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::allocator.35" = type { i8 }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.38", %"struct.std::_Head_base.41" }
%"struct.std::_Tuple_impl.38" = type { %"struct.std::_Tuple_impl.39", %"struct.std::_Head_base.40" }
%"struct.std::_Tuple_impl.39" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %"struct.rmg::Vec2" }
%"struct.rmg::Vec2" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { float, float }
%"struct.std::_Head_base.40" = type { %"struct.rmg::Vec3" }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.std::_Head_base.41" = type { %"struct.rmg::Vec3" }
%"struct.std::__detail::_Node_iterator.42" = type { %"struct.std::__detail::_Node_iterator_base.43" }
%"struct.std::__detail::_Node_iterator_base.43" = type { ptr }
%"struct.std::pair.44" = type { %"class.std::tuple", 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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) #2

; 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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3rmg4Mesh13buildIndices2Ev(ptr nocapture noundef nonnull align 8 dereferenceable(52) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.anon.15, align 1
  %3 = alloca %class.anon.17, align 1
  %4 = alloca %"class.std::unordered_map.19", align 8
  %5 = alloca %"class.std::allocator.35", align 1
  %6 = alloca %"class.std::tuple", align 4
  %7 = alloca %"struct.std::__detail::_Node_iterator.42", align 8
  %8 = alloca %"struct.std::__detail::_Node_iterator.42", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.44", align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaISt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEEC2EmRKS6_RKS7_RKSB_"(ptr noundef nonnull align 8 dereferenceable(56) %4, i64 noundef 65536, ptr noundef nonnull align 1 dereferenceable(1) %2, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %11 unwind label %50

11:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %13, ptr %14, align 8, !tbaa !11
  %15 = zext i32 %13 to i64
  %16 = shl nuw nsw i64 %15, 2
  %17 = call noalias ptr @malloc(i64 noundef %16) #8
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %17, ptr %18, align 8, !tbaa !12
  %19 = mul nuw nsw i64 %15, 12
  %20 = call noalias ptr @malloc(i64 noundef %19) #8
  %21 = call noalias ptr @malloc(i64 noundef %19) #8
  %22 = shl nuw nsw i64 %15, 3
  %23 = call noalias ptr @malloc(i64 noundef %22) #8
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  br label %52

._crit_edge:                                      ; preds = %92, %11
  %27 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr %12, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  call void @free(ptr noundef %30) #7
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  call void @free(ptr noundef %32) #7
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  call void @free(ptr noundef %34) #7
  %35 = load i32, ptr %12, align 8, !tbaa !5
  %36 = zext i32 %35 to i64
  %37 = mul nuw nsw i64 %36, 12
  %38 = call noalias ptr @malloc(i64 noundef %37) #8
  store ptr %38, ptr %29, align 8, !tbaa !13
  %39 = call noalias ptr @malloc(i64 noundef %37) #8
  store ptr %39, ptr %31, align 8, !tbaa !14
  %40 = shl nuw nsw i64 %36, 3
  %41 = call noalias ptr @malloc(i64 noundef %40) #8
  store ptr %41, ptr %33, align 8, !tbaa !15
  %42 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %43 = mul i64 %42, 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %20, i64 %43, i1 false)
  %44 = load ptr, ptr %31, align 8, !tbaa !14
  %45 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %46 = mul i64 %45, 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %21, i64 %46, i1 false)
  %47 = load ptr, ptr %33, align 8, !tbaa !15
  %48 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %49 = shl i64 %48, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %47, ptr align 4 %23, i64 %49, i1 false)
  call void @free(ptr noundef %20) #7
  call void @free(ptr noundef %21) #7
  call void @free(ptr noundef %23) #7
  call void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  ret void

50:                                               ; preds = %1
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %97

52:                                               ; preds = %.lr.ph, %92
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %92 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  %53 = load ptr, ptr %24, align 8, !tbaa !13
  %54 = getelementptr inbounds %"struct.rmg::Vec3", ptr %53, i64 %indvars.iv
  %55 = load ptr, ptr %25, align 8, !tbaa !14
  %56 = getelementptr inbounds %"struct.rmg::Vec3", ptr %55, i64 %indvars.iv
  %57 = load ptr, ptr %26, align 8, !tbaa !15
  %58 = getelementptr inbounds %"struct.rmg::Vec2", ptr %57, i64 %indvars.iv
  call void @_ZSt10make_tupleIJRN3rmg4Vec3ES2_RNS0_4Vec2EEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %54, ptr noundef nonnull align 4 dereferenceable(12) %56, ptr noundef nonnull align 4 dereferenceable(8) %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %59 = invoke ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4findERS9_"(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 4 dereferenceable(32) %6)
          to label %60 unwind label %82

60:                                               ; preds = %52
  store ptr %59, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %61 = call ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  store ptr %61, ptr %8, align 8
  %62 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb1EEESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %62, label %63, label %86

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %64 = call noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %65 = trunc i64 %64 to i32
  store i32 %65, ptr %9, align 4, !tbaa !16
  %66 = load ptr, ptr %24, align 8, !tbaa !13
  %67 = getelementptr inbounds %"struct.rmg::Vec3", ptr %66, i64 %indvars.iv
  %68 = and i64 %64, 4294967295
  %69 = getelementptr inbounds %"struct.rmg::Vec3", ptr %20, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %69, ptr noundef nonnull align 4 dereferenceable(12) %67, i64 12, i1 false), !tbaa.struct !17
  %70 = load ptr, ptr %25, align 8, !tbaa !14
  %71 = getelementptr inbounds %"struct.rmg::Vec3", ptr %70, i64 %indvars.iv
  %72 = getelementptr inbounds %"struct.rmg::Vec3", ptr %21, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %72, ptr noundef nonnull align 4 dereferenceable(12) %71, i64 12, i1 false), !tbaa.struct !17
  %73 = load ptr, ptr %26, align 8, !tbaa !15
  %74 = getelementptr inbounds %"struct.rmg::Vec2", ptr %73, i64 %indvars.iv
  %75 = getelementptr inbounds %"struct.rmg::Vec2", ptr %23, i64 %68
  %76 = load i64, ptr %74, align 4, !tbaa !18
  store i64 %76, ptr %75, align 4, !tbaa !18
  %77 = load ptr, ptr %18, align 8, !tbaa !12
  %78 = getelementptr inbounds i32, ptr %77, i64 %indvars.iv
  store i32 %65, ptr %78, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #7
  invoke void @_ZSt9make_pairIRSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEERjESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.44") align 4 %10, ptr noundef nonnull align 4 dereferenceable(32) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %79 unwind label %84

79:                                               ; preds = %63
  %80 = invoke { ptr, i8 } @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE6insertIRS8_IS4_jEEENSt9enable_ifIXsr16is_constructibleISA_OT_EE5valueES8_INSt8__detail14_Node_iteratorISA_Lb0ELb1EEEbEE4typeESI_"(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 4 dereferenceable(36) %10)
          to label %81 unwind label %84

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %92

82:                                               ; preds = %52
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %96

84:                                               ; preds = %79, %63
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %96

86:                                               ; preds = %60
  %87 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %88 = getelementptr inbounds i8, ptr %87, i64 32
  %89 = load i32, ptr %88, align 4, !tbaa !19
  %90 = load ptr, ptr %18, align 8, !tbaa !12
  %91 = getelementptr inbounds i32, ptr %90, i64 %indvars.iv
  store i32 %89, ptr %91, align 4, !tbaa !16
  br label %92

92:                                               ; preds = %86, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %93 = load i32, ptr %12, align 8, !tbaa !5
  %94 = zext i32 %93 to i64
  %95 = icmp ult i64 %indvars.iv.next, %94
  br i1 %95, label %52, label %._crit_edge, !llvm.loop !30

96:                                               ; preds = %84, %82
  %.pn = phi { ptr, i32 } [ %85, %84 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  br label %97

97:                                               ; preds = %96, %50
  %.pn.pn = phi { ptr, i32 } [ %.pn, %96 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn.pn
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEEC2EmRKS6_RKS7_RKSB_"(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIKSt5tupleIJN3rmg4Vec3ES3_NS2_4Vec2EEEjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJRN3rmg4Vec3ES2_RNS0_4Vec2EEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS8_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4findERS9_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb1EEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZNKSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEERjESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.44") align 4, ptr noundef nonnull align 4 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEE6insertIRS8_IS4_jEEENSt9enable_ifIXsr16is_constructibleISA_OT_EE5valueES8_INSt8__detail14_Node_iteratorISA_Lb0ELb1EEEbEE4typeESI_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKSt5tupleIJN3rmg4Vec3ES4_NS3_4Vec2EEEjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt13unordered_mapISt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjZNS1_4Mesh13buildIndices2EvE3$_0ZNS5_13buildIndices2EvE3$_1SaISt4pairIKS4_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = { 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 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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 32}
!6 = !{!"_ZTSN3rmg4MeshE", !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !10, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 48}
!12 = !{!6, !7, i64 40}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 16}
!15 = !{!6, !7, i64 24}
!16 = !{!10, !10, i64 0}
!17 = !{i64 0, i64 12, !18}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !10, i64 32}
!20 = !{!"_ZTSSt4pairIKSt5tupleIJN3rmg4Vec3ES2_NS1_4Vec2EEEjE", !21, i64 0, !10, i64 32}
!21 = !{!"_ZTSSt5tupleIJN3rmg4Vec3ES1_NS0_4Vec2EEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJN3rmg4Vec3ES1_NS0_4Vec2EEE", !23, i64 0, !29, i64 20}
!23 = !{!"_ZTSSt11_Tuple_implILm1EJN3rmg4Vec3ENS0_4Vec2EEE", !24, i64 0, !27, i64 8}
!24 = !{!"_ZTSSt11_Tuple_implILm2EJN3rmg4Vec2EEE", !25, i64 0}
!25 = !{!"_ZTSSt10_Head_baseILm2EN3rmg4Vec2ELb0EE", !26, i64 0}
!26 = !{!"_ZTSN3rmg4Vec2E", !8, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm1EN3rmg4Vec3ELb0EE", !28, i64 0}
!28 = !{!"_ZTSN3rmg4Vec3E", !8, i64 0}
!29 = !{!"_ZTSSt10_Head_baseILm0EN3rmg4Vec3ELb0EE", !28, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass