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

; 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 = type { i8 }
%class.anon.2 = type { i8 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = 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.6" = type { i8 }
%"struct.std::pair" = type { %"struct.rmg::Vec3", %"struct.rmg::Vec3" }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.9" = type { %"struct.std::pair", i32 }
%"struct.std::pair.11" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"class.rmg::Mesh" = type <{ ptr, ptr, ptr, ptr, i32, [4 x i8], ptr, i32, [4 x i8] }>
%"struct.std::pair.13" = type { %"struct.std::pair", 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 @_ZN3rmg4Mesh13buildIndices1Ev(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, align 1
  %4 = alloca %class.anon.2, align 1
  %5 = alloca %"class.std::unordered_map", align 8
  %6 = alloca %"class.std::allocator.6", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %14 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair.9", align 4
  %17 = alloca %"struct.std::pair.11", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %18 = 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 @_ZNSaISt4pairIKS_IN3rmg4Vec3ES1_EjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEEC2EmRKS5_RKS6_RKS9_"(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 %19 unwind label %45

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

39:                                               ; preds = %125, %19
  %40 = load i32, ptr %11, align 4, !tbaa !14
  %41 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 4
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = icmp ult i32 %40, %42
  br i1 %43, label %49, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %130

45:                                               ; preds = %1
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  call void @_ZNSt15__new_allocatorISt4pairIKS0_IN3rmg4Vec3ES2_EjEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %162

49:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  %50 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  %52 = load i32, ptr %11, align 4, !tbaa !14
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %"struct.rmg::Vec3", ptr %51, i64 %53
  %55 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = load i32, ptr %11, align 4, !tbaa !14
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds %"struct.rmg::Vec3", ptr %56, i64 %58
  invoke void @_ZSt9make_pairIRN3rmg4Vec3ES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %54, ptr noundef nonnull align 4 dereferenceable(12) %59)
          to label %60 unwind label %103

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %61 = invoke ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4findERS7_"(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 4 dereferenceable(24) %12)
          to label %62 unwind label %107

62:                                               ; preds = %60
  %63 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %13, i32 0, i32 0
  %64 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %63, i32 0, i32 0
  store ptr %61, ptr %64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %65 = call ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %66 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %14, i32 0, i32 0
  %67 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %66, i32 0, i32 0
  store ptr %65, ptr %67, align 8
  %68 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKS1_IN3rmg4Vec3ES3_EjELb1EEES9_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br i1 %68, label %69, label %115

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %70 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %15, align 4, !tbaa !14
  %72 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %74 = load i32, ptr %11, align 4, !tbaa !14
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds %"struct.rmg::Vec3", ptr %73, i64 %75
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = load i32, ptr %15, align 4, !tbaa !14
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %"struct.rmg::Vec3", ptr %77, i64 %79
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %80, ptr align 4 %76, i64 12, i1 false), !tbaa.struct !17
  %81 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !16
  %83 = load i32, ptr %11, align 4, !tbaa !14
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds %"struct.rmg::Vec3", ptr %82, i64 %84
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = load i32, ptr %15, align 4, !tbaa !14
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds %"struct.rmg::Vec3", ptr %86, i64 %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %89, ptr align 4 %85, i64 12, i1 false), !tbaa.struct !17
  %90 = load i32, ptr %15, align 4, !tbaa !14
  %91 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 6
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  %93 = load i32, ptr %11, align 4, !tbaa !14
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr %92, i64 %94
  store i32 %90, ptr %95, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 28, ptr %16) #7
  invoke void @_ZSt9make_pairIRSt4pairIN3rmg4Vec3ES2_ERjES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS6_INS7_IT0_E4typeEE6__typeEEOS8_OSD_(ptr dead_on_unwind writable sret(%"struct.std::pair.9") align 4 %16, ptr noundef nonnull align 4 dereferenceable(24) %12, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %96 unwind label %111

96:                                               ; preds = %69
  %97 = invoke { ptr, i8 } @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE6insertIRS0_IS3_jEEENSt9enable_ifIXsr16is_constructibleIS8_OT_EE5valueES0_INSt8__detail14_Node_iteratorIS8_Lb0ELb1EEEbEE4typeESG_"(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 4 dereferenceable(28) %16)
          to label %98 unwind label %111

98:                                               ; preds = %96
  %99 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %100 = extractvalue { ptr, i8 } %97, 0
  store ptr %100, ptr %99, align 8
  %101 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %102 = extractvalue { ptr, i8 } %97, 1
  store i8 %102, ptr %101, align 8
  call void @llvm.lifetime.end.p0(i64 28, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %124

103:                                              ; preds = %49
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %7, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %8, align 4
  br label %129

107:                                              ; preds = %60
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %7, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %8, align 4
  br label %128

111:                                              ; preds = %96, %69
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %7, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 28, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %128

115:                                              ; preds = %62
  %116 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKS1_IN3rmg4Vec3ES3_EjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %117 = getelementptr inbounds %"struct.std::pair.13", ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !19
  %119 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !13
  %121 = load i32, ptr %11, align 4, !tbaa !14
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %120, i64 %122
  store i32 %118, ptr %123, align 4, !tbaa !14
  br label %124

124:                                              ; preds = %115, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %11, align 4, !tbaa !14
  %127 = add i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !14
  br label %39, !llvm.loop !23

128:                                              ; preds = %111, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %129

129:                                              ; preds = %128, %103
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, 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_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  br label %162

130:                                              ; preds = %44
  %131 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %132 = trunc i64 %131 to i32
  %133 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 4
  store i32 %132, ptr %133, align 8, !tbaa !9
  %134 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !15
  call void @free(ptr noundef %135) #7
  %136 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !16
  call void @free(ptr noundef %137) #7
  %138 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 4
  %139 = load i32, ptr %138, align 8, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = mul i64 12, %140
  %142 = call noalias ptr @malloc(i64 noundef %141) #8
  %143 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 1
  store ptr %142, ptr %143, align 8, !tbaa !15
  %144 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 4
  %145 = load i32, ptr %144, align 8, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = mul i64 12, %146
  %148 = call noalias ptr @malloc(i64 noundef %147) #8
  %149 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 2
  store ptr %148, ptr %149, align 8, !tbaa !16
  %150 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 1
  %151 = load ptr, ptr %150, align 8, !tbaa !15
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %154 = mul i64 12, %153
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %151, ptr align 4 %152, i64 %154, i1 false)
  %155 = getelementptr inbounds %"class.rmg::Mesh", ptr %18, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !16
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  %159 = mul i64 12, %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %156, ptr align 4 %157, i64 %159, i1 false)
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %160) #7
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %161) #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_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_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

162:                                              ; preds = %129, %45
  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 %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %7, align 8
  %165 = load i32, ptr %8, align 4
  %166 = insertvalue { ptr, i32 } poison, ptr %164, 0
  %167 = insertvalue { ptr, i32 } %166, i32 %165, 1
  resume { ptr, i32 } %167
}

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEEC2EmRKS5_RKS6_RKS9_"(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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4findERS7_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(24)) #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE6insertIRS0_IS3_jEEENSt9enable_ifIXsr16is_constructibleIS8_OT_EE5valueES0_INSt8__detail14_Node_iteratorIS8_Lb0ELb1EEEbEE4typeESG_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(28)) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_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 = !{i64 0, i64 12, !18}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !11, i64 24}
!20 = !{!"_ZTSSt4pairIKS_IN3rmg4Vec3ES1_EjE", !21, i64 0, !11, i64 24}
!21 = !{!"_ZTSSt4pairIN3rmg4Vec3ES1_E", !22, i64 0, !22, i64 12}
!22 = !{!"_ZTSN3rmg4Vec3E", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"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 = type { i8 }
%class.anon.2 = type { i8 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = 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.6" = type { i8 }
%"struct.std::pair" = type { %"struct.rmg::Vec3", %"struct.rmg::Vec3" }
%"struct.rmg::Vec3" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.9" = type { %"struct.std::pair", 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 @_ZN3rmg4Mesh13buildIndices1Ev(ptr nocapture noundef nonnull align 8 dereferenceable(52) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.anon, align 1
  %3 = alloca %class.anon.2, align 1
  %4 = alloca %"class.std::unordered_map", align 8
  %5 = alloca %"class.std::allocator.6", align 1
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %8 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.9", 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 @_ZNSaISt4pairIKS_IN3rmg4Vec3ES1_EjEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEEC2EmRKS5_RKS6_RKS9_"(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 %40

11:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorISt4pairIKS0_IN3rmg4Vec3ES2_EjEED2Ev(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
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  br label %42

._crit_edge:                                      ; preds = %79, %11
  %24 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %12, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  call void @free(ptr noundef %27) #7
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  call void @free(ptr noundef %29) #7
  %30 = load i32, ptr %12, align 8, !tbaa !5
  %31 = zext i32 %30 to i64
  %32 = mul nuw nsw i64 %31, 12
  %33 = call noalias ptr @malloc(i64 noundef %32) #8
  store ptr %33, ptr %26, align 8, !tbaa !13
  %34 = call noalias ptr @malloc(i64 noundef %32) #8
  store ptr %34, ptr %28, align 8, !tbaa !14
  %35 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %36 = mul i64 %35, 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %20, i64 %36, i1 false)
  %37 = load ptr, ptr %28, align 8, !tbaa !14
  %38 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %39 = mul i64 %38, 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %21, i64 %39, i1 false)
  call void @free(ptr noundef %20) #7
  call void @free(ptr noundef %21) #7
  call void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_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

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

42:                                               ; preds = %.lr.ph, %79
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %79 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  %43 = load ptr, ptr %22, align 8, !tbaa !13
  %44 = getelementptr inbounds %"struct.rmg::Vec3", ptr %43, i64 %indvars.iv
  %45 = load ptr, ptr %23, align 8, !tbaa !14
  %46 = getelementptr inbounds %"struct.rmg::Vec3", ptr %45, i64 %indvars.iv
  invoke void @_ZSt9make_pairIRN3rmg4Vec3ES2_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %46)
          to label %47 unwind label %67

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %48 = invoke ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4findERS7_"(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 4 dereferenceable(24) %6)
          to label %49 unwind label %69

49:                                               ; preds = %47
  store ptr %48, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %50 = call ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  store ptr %50, ptr %8, align 8
  %51 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKS1_IN3rmg4Vec3ES3_EjELb1EEES9_(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 %51, label %52, label %73

52:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %53 = call noundef i64 @"_ZNKSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4sizeEv"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %9, align 4, !tbaa !15
  %55 = load ptr, ptr %22, align 8, !tbaa !13
  %56 = getelementptr inbounds %"struct.rmg::Vec3", ptr %55, i64 %indvars.iv
  %57 = and i64 %53, 4294967295
  %58 = getelementptr inbounds %"struct.rmg::Vec3", ptr %20, i64 %57
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %58, ptr noundef nonnull align 4 dereferenceable(12) %56, i64 12, i1 false), !tbaa.struct !16
  %59 = load ptr, ptr %23, align 8, !tbaa !14
  %60 = getelementptr inbounds %"struct.rmg::Vec3", ptr %59, i64 %indvars.iv
  %61 = getelementptr inbounds %"struct.rmg::Vec3", ptr %21, i64 %57
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %61, ptr noundef nonnull align 4 dereferenceable(12) %60, i64 12, i1 false), !tbaa.struct !16
  %62 = load ptr, ptr %18, align 8, !tbaa !12
  %63 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv
  store i32 %54, ptr %63, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %10) #7
  invoke void @_ZSt9make_pairIRSt4pairIN3rmg4Vec3ES2_ERjES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS6_INS7_IT0_E4typeEE6__typeEEOS8_OSD_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.9") align 4 %10, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %64 unwind label %71

64:                                               ; preds = %52
  %65 = invoke { ptr, i8 } @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE6insertIRS0_IS3_jEEENSt9enable_ifIXsr16is_constructibleIS8_OT_EE5valueES0_INSt8__detail14_Node_iteratorIS8_Lb0ELb1EEEbEE4typeESG_"(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 4 dereferenceable(28) %10)
          to label %66 unwind label %71

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

67:                                               ; preds = %42
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %84

69:                                               ; preds = %47
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %83

71:                                               ; preds = %64, %52
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %83

73:                                               ; preds = %49
  %74 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKS1_IN3rmg4Vec3ES3_EjELb0ELb1EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %75 = getelementptr inbounds i8, ptr %74, i64 24
  %76 = load i32, 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 %76, ptr %78, align 4, !tbaa !15
  br label %79

79:                                               ; preds = %73, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %80 = load i32, ptr %12, align 8, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = icmp ult i64 %indvars.iv.next, %81
  br i1 %82, label %42, label %._crit_edge, !llvm.loop !22

83:                                               ; preds = %71, %69
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %84

84:                                               ; preds = %83, %67
  %.pn.pn = phi { ptr, i32 } [ %.pn, %83 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEED2Ev"(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  br label %85

85:                                               ; preds = %84, %40
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %84 ], [ %41, %40 ]
  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.pn
}

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEEC2EmRKS5_RKS6_RKS9_"(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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE4findERS7_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKS1_IN3rmg4Vec3ES3_EjELb1EEES9_(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_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE3endEv"(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare hidden { ptr, i8 } @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_jEEE6insertIRS0_IS3_jEEENSt9enable_ifIXsr16is_constructibleIS8_OT_EE5valueES0_INSt8__detail14_Node_iteratorIS8_Lb0ELb1EEEbEE4typeESG_"(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt13unordered_mapISt4pairIN3rmg4Vec3ES2_EjZNS1_4Mesh13buildIndices1EvE3$_0ZNS4_13buildIndices1EvE3$_1SaIS0_IKS3_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 = !{!10, !10, i64 0}
!16 = !{i64 0, i64 12, !17}
!17 = !{!8, !8, i64 0}
!18 = !{!19, !10, i64 24}
!19 = !{!"_ZTSSt4pairIKS_IN3rmg4Vec3ES1_EjE", !20, i64 0, !10, i64 24}
!20 = !{!"_ZTSSt4pairIN3rmg4Vec3ES1_E", !21, i64 0, !21, i64 12}
!21 = !{!"_ZTSN3rmg4Vec3E", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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