; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnextract/writers_vxl.ll (Z8VThroatsRK12blockNetwork)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.voxelField.0 = type { ptr, i64, %class.var3, %"class.std::vector.1" }
%class.var3 = type { i32, i32, i32 }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.57" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.63" = type { ptr }
%class.blockNetwork = type { ptr, i32, i32, i32, ptr, %"struct.std::array", %class.voxelImageT, %"class.std::vector.7", %"class.std::vector.12", %"class.std::vector.17", %"class.std::vector.17", i32, i32, i32, i32 }
%"struct.std::array" = type { [8 x %class.voxel] }
%class.voxel = type <{ ptr, i16, i16, i16, [2 x i8], float, [4 x i8] }>
%class.voxelImageT = type { %class.voxelImageTBase, %class.voxelField.0, %class.var3.6, %class.var3.6 }
%class.voxelImageTBase = type { ptr }
%class.var3.6 = type { double, double, double }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<poreNE *, std::allocator<poreNE *>>::_Vector_impl" }
%"struct.std::_Vector_base<poreNE *, std::allocator<poreNE *>>::_Vector_impl" = type { %"struct.std::_Vector_base<poreNE *, std::allocator<poreNE *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<poreNE *, std::allocator<poreNE *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<throatNE *, std::allocator<throatNE *>>::_Vector_impl" }
%"struct.std::_Vector_base<throatNE *, std::allocator<throatNE *>>::_Vector_impl" = type { %"struct.std::_Vector_base<throatNE *, std::allocator<throatNE *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<throatNE *, std::allocator<throatNE *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<medialBall *, std::allocator<medialBall *>>::_Vector_impl" }
%"struct.std::_Vector_base<medialBall *, std::allocator<medialBall *>>::_Vector_impl" = type { %"struct.std::_Vector_base<medialBall *, std::allocator<medialBall *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<medialBall *, std::allocator<medialBall *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.throatNE = type { i32, i32, i32, i32, i32, i16, i16, %"class.std::vector.58", %"class.std::vector.58", %class.var3.6 }
%"class.std::vector.58" = type { %"struct.std::_Vector_base.59" }
%"struct.std::_Vector_base.59" = type { %"struct.std::_Vector_base<voxel *, std::allocator<voxel *>>::_Vector_impl" }
%"struct.std::_Vector_base<voxel *, std::allocator<voxel *>>::_Vector_impl" = type { %"struct.std::_Vector_base<voxel *, std::allocator<voxel *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<voxel *, std::allocator<voxel *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8VThroatsRK12blockNetwork(ptr dead_on_unwind noalias writable sret(%class.voxelField.0) align 8 %0, ptr noundef nonnull align 8 dereferenceable(448) %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca %class.var3, align 4
  %7 = alloca { i64, i32 }, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i1 false, ptr %5, align 1
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.blockNetwork, ptr %22, i32 0, i32 6
  %24 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK11voxelImageTIiE5size3Ev(ptr noundef nonnull align 8 dereferenceable(112) %23)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %6, i64 12, i1 false)
  %25 = getelementptr inbounds { i64, i32 }, ptr %7, i32 0, i32 0
  %26 = load i64, ptr %25, align 4
  %27 = getelementptr inbounds { i64, i32 }, ptr %7, i32 0, i32 1
  %28 = load i32, ptr %27, align 4
  call void @_ZN10voxelFieldIiEC2E4var3IiEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 %26, i32 %28, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.blockNetwork, ptr %29, i32 0, i32 8
  store ptr %30, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call ptr @_ZNKSt6vectorIP8throatNESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %9, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = call ptr @_ZNKSt6vectorIP8throatNESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.57", ptr %10, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  br label %37

37:                                               ; preds = %87, %2
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP8throatNESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %38, label %40, label %39

39:                                               ; preds = %37
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %89

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKP8throatNESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.throatNE, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !12
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %13, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.throatNE, ptr %47, i32 0, i32 7
  store ptr %48, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = call ptr @_ZNSt6vectorIP5voxelSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  %51 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.63", ptr %15, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = call ptr @_ZNSt6vectorIP5voxelSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #6
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.63", ptr %16, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  br label %55

55:                                               ; preds = %80, %40
  %56 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5voxelSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  br i1 %56, label %58, label %57

57:                                               ; preds = %55
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %86

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5voxelSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %17, align 8, !tbaa !5
  %61 = load i32, ptr %13, align 4, !tbaa !10
  %62 = load ptr, ptr %17, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.voxel, ptr %62, i32 0, i32 1
  %64 = load i16, ptr %63, align 8, !tbaa !21
  %65 = sext i16 %64 to i32
  %66 = add nsw i32 %65, 1
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.voxel, ptr %67, i32 0, i32 2
  %69 = load i16, ptr %68, align 2, !tbaa !24
  %70 = sext i16 %69 to i32
  %71 = add nsw i32 %70, 1
  %72 = load ptr, ptr %17, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.voxel, ptr %72, i32 0, i32 3
  %74 = load i16, ptr %73, align 4, !tbaa !25
  %75 = sext i16 %74 to i32
  %76 = add nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN10voxelFieldIiEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %66, i32 noundef %71, i64 noundef %77)
          to label %79 unwind label %82

79:                                               ; preds = %58
  store i32 %61, ptr %78, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %80

80:                                               ; preds = %79
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5voxelSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %55

82:                                               ; preds = %58
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %18, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @_ZN10voxelFieldIiED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %93

86:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %87

87:                                               ; preds = %86
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKP8throatNESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %37

89:                                               ; preds = %39
  store i1 true, ptr %5, align 1
  store i32 1, ptr %11, align 4
  %90 = load i1, ptr %5, align 1
  br i1 %90, label %92, label %91

91:                                               ; preds = %89
  call void @_ZN10voxelFieldIiED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %92

92:                                               ; preds = %91, %89
  ret void

93:                                               ; preds = %82
  %94 = load ptr, ptr %18, align 8
  %95 = load i32, ptr %19, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK11voxelImageTIiE5size3Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10voxelFieldIiEC2E4var3IiEi(ptr noundef nonnull align 8 dereferenceable(56), i64, i32, i32 noundef) unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN10voxelFieldIiEclEiim(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, i64 noundef) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10voxelFieldIiED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"_ZTS8throatNE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !14, i64 20, !14, i64 22, !15, i64 24, !15, i64 48, !19, i64 72}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIP5voxelSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP5voxelSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP5voxelSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP5voxelSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTS4var3IdE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"double", !7, i64 0}
!21 = !{!22, !14, i64 8}
!22 = !{!"_ZTS5voxel", !6, i64 0, !14, i64 8, !14, i64 10, !14, i64 12, !23, i64 16}
!23 = !{!"float", !7, i64 0}
!24 = !{!22, !14, i64 10}
!25 = !{!22, !14, i64 12}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.voxelField.0 = type { ptr, i64, %class.var3, %"class.std::vector.1" }
%class.var3 = type { i32, i32, i32 }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.57" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.63" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8VThroatsRK12blockNetwork(ptr dead_on_unwind noalias writable sret(%class.voxelField.0) align 8 %0, ptr noundef nonnull align 8 dereferenceable(448) %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.57", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %9 = getelementptr inbounds i8, ptr %1, i64 224
  %10 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK11voxelImageTIiE5size3Ev(ptr noundef nonnull align 8 dereferenceable(112) %9)
  %.sroa.09.0.copyload = load i64, ptr %10, align 4
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %.sroa.210.0.copyload = load i32, ptr %.sroa.210.0..sroa_idx, align 4, !tbaa !5
  tail call void @_ZN10voxelFieldIiEC2E4var3IiEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 %.sroa.09.0.copyload, i32 %.sroa.210.0.copyload, i32 noundef 0)
  %11 = getelementptr inbounds i8, ptr %1, i64 360
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %12 = tail call ptr @_ZNKSt6vectorIP8throatNESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %12, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %13 = tail call ptr @_ZNKSt6vectorIP8throatNESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %13, ptr %4, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP8throatNESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br i1 %14, label %.lr.ph15, label %._crit_edge16

._crit_edge16:                                    ; preds = %._crit_edge, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void

.lr.ph15:                                         ; preds = %2, %._crit_edge
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKP8throatNESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = add nsw i32 %17, 1
  %19 = getelementptr inbounds i8, ptr %16, i64 24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = call ptr @_ZNSt6vectorIP5voxelSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %20, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %21 = call ptr @_ZNSt6vectorIP5voxelSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %21, ptr %6, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5voxelSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKP8throatNESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %24 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKP8throatNESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br i1 %24, label %.lr.ph15, label %._crit_edge16

.lr.ph:                                           ; preds = %.lr.ph15, %.lr.ph
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5voxelSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i16, ptr %27, align 8, !tbaa !20
  %29 = sext i16 %28 to i32
  %30 = add nsw i32 %29, 1
  %31 = getelementptr inbounds i8, ptr %26, i64 10
  %32 = load i16, ptr %31, align 2, !tbaa !23
  %33 = sext i16 %32 to i32
  %34 = add nsw i32 %33, 1
  %35 = getelementptr inbounds i8, ptr %26, i64 12
  %36 = load i16, ptr %35, align 4, !tbaa !24
  %37 = sext i16 %36 to i64
  %38 = add nsw i64 %37, 1
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN10voxelFieldIiEclEiim(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %30, i32 noundef %34, i64 noundef %38)
  store i32 %18, ptr %39, align 4, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5voxelSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5voxelSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %41, label %.lr.ph, label %._crit_edge
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNK11voxelImageTIiE5size3Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10voxelFieldIiEC2E4var3IiEi(ptr noundef nonnull align 8 dereferenceable(56), i64, i32, i32 noundef) unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN10voxelFieldIiEclEiim(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

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

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !6, i64 0}
!12 = !{!"_ZTS8throatNE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !13, i64 20, !13, i64 22, !14, i64 24, !14, i64 48, !18, i64 72}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIP5voxelSaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIP5voxelSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIP5voxelSaIS1_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP5voxelSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!"_ZTS4var3IdE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"double", !7, i64 0}
!20 = !{!21, !13, i64 8}
!21 = !{!"_ZTS5voxel", !10, i64 0, !13, i64 8, !13, i64 10, !13, i64 12, !22, i64 16}
!22 = !{!"float", !7, i64 0}
!23 = !{!21, !13, i64 10}
!24 = !{!21, !13, i64 12}


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