; LLVM IR from BlueBrain/CoreNeuron :: coreneuron/permute/cellorder1.ll (ZN10coreneuron10node_orderEiiPiRiS1_RS0_S2_S2_S2_S2_)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.coreneuron::TNode" = type <{ ptr, ptr, %"class.std::vector", i64, i64, i64, i64, i64, i64, i64, i32, [4 x i8] }>

@_ZN10coreneuron23interleave_permute_typeE = external global i32, align 4
@_ZN10coreneuronL9groupsizeE = external hidden global i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN10coreneuron5TNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10coreneuron15level_from_rootERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10coreneuron10node_orderEiiPiRiS1_RS0_S2_S2_S2_S2_(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #2 personality ptr @__gxx_personality_v0 {
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"class.std::vector", align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i64, align 8
  store i32 %0, ptr %11, align 4, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !9
  store ptr %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !9
  store ptr %9, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %30 = load ptr, ptr %13, align 8, !tbaa !9
  %31 = load i32, ptr %12, align 4, !tbaa !5
  %32 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN10coreneuronL13tree_analysisEPiiiRSt6vectorIPNS_5TNodeESaIS3_EE(ptr noundef %30, i32 noundef %31, i32 noundef %32, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %33 unwind label %44

33:                                               ; preds = %10
  invoke void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %34 unwind label %44

34:                                               ; preds = %33
  %35 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN10coreneuronL13set_cellindexEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef %35, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %36 unwind label %44

36:                                               ; preds = %34
  invoke void @_ZN10coreneuronL14set_groupindexERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %37 unwind label %44

37:                                               ; preds = %36
  %38 = call noundef i64 @_ZN10coreneuron15level_from_rootERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %39 = load i32, ptr @_ZN10coreneuron23interleave_permute_typeE, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %48

41:                                               ; preds = %37
  %42 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN10coreneuronL21node_interleave_orderEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef %42, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %43 unwind label %44

43:                                               ; preds = %41
  br label %53

44:                                               ; preds = %54, %53, %48, %41, %36, %34, %33, %10
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %22, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %23, align 4
  br label %159

48:                                               ; preds = %37
  %49 = load i64, ptr @_ZN10coreneuronL9groupsizeE, align 8, !tbaa !11
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  invoke void @_ZN10coreneuron12group_order2ERSt6vectorIPNS_5TNodeESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %49, i64 noundef %51)
          to label %52 unwind label %44

52:                                               ; preds = %48
  br label %53

53:                                               ; preds = %52, %43
  invoke void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %54 unwind label %44

54:                                               ; preds = %53
  invoke void @_ZN10coreneuronL7qualityERSt6vectorIPNS_5TNodeESaIS2_EEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 32)
          to label %55 unwind label %44

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %56 = load i32, ptr %12, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %57, i64 4)
  %59 = extractvalue { i64, i1 } %58, 1
  %60 = extractvalue { i64, i1 } %58, 0
  %61 = select i1 %59, i64 -1, i64 %60
  %62 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %61) #7
          to label %63 unwind label %69

63:                                               ; preds = %55
  store ptr %62, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %85, %63
  %65 = load i32, ptr %25, align 4, !tbaa !5
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %73, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %88

69:                                               ; preds = %100, %91, %55
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %22, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %159

73:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %74 = load i32, ptr %25, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %75) #6
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  store ptr %77, ptr %26, align 8, !tbaa !9
  %78 = load i32, ptr %25, align 4, !tbaa !5
  %79 = load ptr, ptr %24, align 8, !tbaa !9
  %80 = load ptr, ptr %26, align 8, !tbaa !9
  %81 = getelementptr inbounds %"class.coreneuron::TNode", ptr %80, i32 0, i32 10
  %82 = load i32, ptr %81, align 8, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %79, i64 %83
  store i32 %78, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %85

85:                                               ; preds = %73
  %86 = load i32, ptr %25, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %25, align 4, !tbaa !5
  br label %64, !llvm.loop !19

88:                                               ; preds = %68
  %89 = load i32, ptr @_ZN10coreneuron23interleave_permute_typeE, align 4, !tbaa !5
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %100

91:                                               ; preds = %88
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = load ptr, ptr %14, align 8, !tbaa !9
  %94 = load ptr, ptr %15, align 8, !tbaa !9
  %95 = load ptr, ptr %16, align 8, !tbaa !9
  %96 = load ptr, ptr %17, align 8, !tbaa !9
  %97 = load ptr, ptr %18, align 8, !tbaa !9
  %98 = load ptr, ptr %19, align 8, !tbaa !9
  invoke void @_ZN10coreneuronL6admin1EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_(i32 noundef %92, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull align 8 dereferenceable(8) %98)
          to label %99 unwind label %69

99:                                               ; preds = %91
  br label %110

100:                                              ; preds = %88
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = load ptr, ptr %14, align 8, !tbaa !9
  %103 = load ptr, ptr %15, align 8, !tbaa !9
  %104 = load ptr, ptr %20, align 8, !tbaa !9
  %105 = load ptr, ptr %16, align 8, !tbaa !9
  %106 = load ptr, ptr %17, align 8, !tbaa !9
  %107 = load ptr, ptr %18, align 8, !tbaa !9
  %108 = load ptr, ptr %19, align 8, !tbaa !9
  invoke void @_ZN10coreneuronL6admin2EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_S8_(i32 noundef %101, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(4) %103, ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef nonnull align 8 dereferenceable(8) %108)
          to label %109 unwind label %69

109:                                              ; preds = %100
  br label %110

110:                                              ; preds = %109, %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 1, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %135, %110
  %112 = load i32, ptr %28, align 4, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %138

116:                                              ; preds = %111
  %117 = load i32, ptr %28, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %119) #6
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds %"class.coreneuron::TNode", ptr %121, i32 0, i32 3
  %123 = load i64, ptr %122, align 8, !tbaa !21
  %124 = load i32, ptr %28, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %125) #6
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds %"class.coreneuron::TNode", ptr %127, i32 0, i32 3
  %129 = load i64, ptr %128, align 8, !tbaa !21
  %130 = icmp ne i64 %123, %129
  br i1 %130, label %131, label %134

131:                                              ; preds = %116
  %132 = load i32, ptr %27, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %27, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %131, %116
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %28, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %28, align 4, !tbaa !5
  br label %111, !llvm.loop !22

138:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  store i64 0, ptr %29, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %154, %138
  %140 = load i64, ptr %29, align 8, !tbaa !11
  %141 = call noundef i64 @_ZNKSt6vectorIPN10coreneuron5TNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  %142 = icmp ult i64 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %157

144:                                              ; preds = %139
  %145 = load i64, ptr %29, align 8, !tbaa !11
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %145) #6
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = icmp eq ptr %147, null
  br i1 %148, label %153, label %149

149:                                              ; preds = %144
  %150 = load ptr, ptr %147, align 8, !tbaa !23
  %151 = getelementptr inbounds ptr, ptr %150, i64 1
  %152 = load ptr, ptr %151, align 8
  call void %152(ptr noundef nonnull align 8 dereferenceable(100) %147) #6
  br label %153

153:                                              ; preds = %149, %144
  br label %154

154:                                              ; preds = %153
  %155 = load i64, ptr %29, align 8, !tbaa !11
  %156 = add i64 %155, 1
  store i64 %156, ptr %29, align 8, !tbaa !11
  br label %139, !llvm.loop !25

157:                                              ; preds = %143
  %158 = load ptr, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  ret ptr %158

159:                                              ; preds = %69, %44
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %22, align 8
  %162 = load i32, ptr %23, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL13tree_analysisEPiiiRSt6vectorIPNS_5TNodeESaIS3_EE(ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN10coreneuronL13set_cellindexEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN10coreneuronL14set_groupindexERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL21node_interleave_orderEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2

declare void @_ZN10coreneuron12group_order2ERSt6vectorIPNS_5TNodeESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL7qualityERSt6vectorIPNS_5TNodeESaIS2_EEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL6admin1EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL6admin2EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_S8_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 96}
!14 = !{!"_ZTSN10coreneuron5TNodeE", !10, i64 8, !15, i64 16, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !6, i64 96}
!15 = !{!"_ZTSSt6vectorIPN10coreneuron5TNodeESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!14, !12, i64 40}
!22 = distinct !{!22, !20}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = distinct !{!25, !20}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<coreneuron::TNode *, std::allocator<coreneuron::TNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN10coreneuron23interleave_permute_typeE = external local_unnamed_addr global i32, align 4
@_ZN10coreneuronL9groupsizeE = external hidden local_unnamed_addr global i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN10coreneuron5TNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10coreneuron15level_from_rootERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10coreneuron10node_orderEiiPiRiS1_RS0_S2_S2_S2_S2_(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  invoke void @_ZN10coreneuronL13tree_analysisEPiiiRSt6vectorIPNS_5TNodeESaIS3_EE(ptr noundef %2, i32 noundef %1, i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %12 unwind label %18

12:                                               ; preds = %10
  invoke void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %13 unwind label %18

13:                                               ; preds = %12
  call void @_ZN10coreneuronL13set_cellindexEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @_ZN10coreneuronL14set_groupindexERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %14 = call noundef i64 @_ZN10coreneuron15level_from_rootERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %15 = load i32, ptr @_ZN10coreneuron23interleave_permute_typeE, align 4, !tbaa !5
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %17, label %20

17:                                               ; preds = %13
  invoke void @_ZN10coreneuronL21node_interleave_orderEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %23 unwind label %18

18:                                               ; preds = %24, %23, %20, %17, %12, %10
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %62

20:                                               ; preds = %13
  %21 = load i64, ptr @_ZN10coreneuronL9groupsizeE, align 8, !tbaa !9
  %22 = sext i32 %0 to i64
  invoke void @_ZN10coreneuron12group_order2ERSt6vectorIPNS_5TNodeESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %21, i64 noundef %22)
          to label %23 unwind label %18

23:                                               ; preds = %20, %17
  invoke void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %24 unwind label %18

24:                                               ; preds = %23
  invoke void @_ZN10coreneuronL7qualityERSt6vectorIPNS_5TNodeESaIS2_EEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 32)
          to label %25 unwind label %18

25:                                               ; preds = %24
  %26 = zext i32 %1 to i64
  %27 = icmp slt i32 %1, 0
  %28 = shl nuw nsw i64 %26, 2
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %29) #6
          to label %.preheader47 unwind label %34

.preheader47:                                     ; preds = %25
  %31 = icmp sgt i32 %1, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader47
  %32 = load i32, ptr @_ZN10coreneuron23interleave_permute_typeE, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %43, label %44

34:                                               ; preds = %44, %43, %25
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %62

.lr.ph:                                           ; preds = %.preheader47, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader47 ]
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %indvars.iv) #5
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %37, i64 96
  %39 = load i32, ptr %38, align 8, !tbaa !13
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %30, i64 %40
  %42 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %42, ptr %41, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

43:                                               ; preds = %._crit_edge
  invoke void @_ZN10coreneuronL6admin1EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %45 unwind label %34

44:                                               ; preds = %._crit_edge
  invoke void @_ZN10coreneuronL6admin2EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_S8_(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %45 unwind label %34

45:                                               ; preds = %44, %43
  %46 = icmp sgt i32 %0, 1
  br i1 %46, label %.lr.ph51.preheader, label %.preheader

.lr.ph51.preheader:                               ; preds = %45
  %wide.trip.count59 = zext nneg i32 %0 to i64
  br label %.lr.ph51

.preheader:                                       ; preds = %.lr.ph51, %45
  %47 = call noundef i64 @_ZNKSt6vectorIPN10coreneuron5TNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %.not = icmp eq i64 %47, 0
  br i1 %.not, label %._crit_edge54, label %.lr.ph53

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.lr.ph51
  %indvars.iv56 = phi i64 [ 1, %.lr.ph51.preheader ], [ %indvars.iv.next57, %.lr.ph51 ]
  %48 = add nsw i64 %indvars.iv56, -1
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %48) #5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %indvars.iv56) #5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count59
  br i1 %exitcond60.not, label %.preheader, label %.lr.ph51, !llvm.loop !21

._crit_edge54:                                    ; preds = %58, %.preheader
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  ret ptr %30

.lr.ph53:                                         ; preds = %.preheader, %58
  %.052 = phi i64 [ %59, %58 ], [ 0, %.preheader ]
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.052) #5
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = icmp eq ptr %52, null
  br i1 %53, label %58, label %54

54:                                               ; preds = %.lr.ph53
  %55 = load ptr, ptr %52, align 8, !tbaa !22
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load ptr, ptr %56, align 8
  call void %57(ptr noundef nonnull align 8 dereferenceable(100) %52) #5
  br label %58

58:                                               ; preds = %.lr.ph53, %54
  %59 = add nuw i64 %.052, 1
  %60 = call noundef i64 @_ZNKSt6vectorIPN10coreneuron5TNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %61 = icmp ult i64 %59, %60
  br i1 %61, label %.lr.ph53, label %._crit_edge54, !llvm.loop !24

62:                                               ; preds = %34, %18
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %19, %18 ]
  call void @_ZNSt6vectorIPN10coreneuron5TNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL13tree_analysisEPiiiRSt6vectorIPNS_5TNodeESaIS3_EE(ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL5checkERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN10coreneuronL13set_cellindexEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN10coreneuronL14set_groupindexERSt6vectorIPNS_5TNodeESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL21node_interleave_orderEiRSt6vectorIPNS_5TNodeESaIS2_EE(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare void @_ZN10coreneuron12group_order2ERSt6vectorIPNS_5TNodeESaIS2_EEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL7qualityERSt6vectorIPNS_5TNodeESaIS2_EEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL6admin1EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN10coreneuronL6admin2EiRSt6vectorIPNS_5TNodeESaIS2_EERiS6_RPiS8_S8_S8_S8_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nobuiltin 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 #5 = { nounwind }
attributes #6 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 96}
!14 = !{!"_ZTSN10coreneuron5TNodeE", !12, i64 8, !15, i64 16, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !6, i64 96}
!15 = !{!"_ZTSSt6vectorIPN10coreneuron5TNodeESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN10coreneuron5TNodeESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !8, i64 0}
!24 = distinct !{!24, !20}


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