; LLVM IR from stonne-simulator/omega :: omega-code/stonne/src/OSMeshMN.ll (ZN8OSMeshMN21setPhysicalConnectionEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::pair" = type { i32, i32 }
%class.OSMeshMN = type <{ %class.MultiplierNetwork, %"class.std::map", %"class.std::map.3", %"class.std::map.3", %"class.std::map.3", i32, i32, i32, i32, i32, [4 x i8] }>
%class.MultiplierNetwork = type { %class.Unit }
%class.Unit = type { ptr, i32, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, MultiplierOS *>, std::_Select1st<std::pair<const std::pair<int, int>, MultiplierOS *>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, MultiplierOS *>, std::_Select1st<std::pair<const std::pair<int, int>, MultiplierOS *>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, Connection *>, std::_Select1st<std::pair<const std::pair<int, int>, Connection *>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, Connection *>, std::_Select1st<std::pair<const std::pair<int, int>, Connection *>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8OSMeshMN21setPhysicalConnectionEv(ptr noundef nonnull align 8 dereferenceable(260) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, 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 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %89, %1
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 5
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp ult i32 %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %92

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

26:                                               ; preds = %84, %25
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 6
  %29 = load i32, ptr %28, align 4, !tbaa !29
  %30 = icmp ult i32 %27, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %26
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %88

32:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %33 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 1
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %33, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  store ptr %35, ptr %7, align 8, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %38, label %59

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %39 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #7
  %40 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 9
  %41 = load i32, ptr %40, align 8, !tbaa !30
  invoke void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64) %39, i32 noundef %41)
          to label %42 unwind label %55

42:                                               ; preds = %38
  store ptr %39, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 2
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %44, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store ptr %43, ptr %45, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN12MultiplierOS16setTopConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %46, ptr noundef %47)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = sub nsw i32 %48, 1
  store i32 %49, ptr %12, align 4, !tbaa !9
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %50 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 1
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %50, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  store ptr %52, ptr %13, align 8, !tbaa !5
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN12MultiplierOS19setBottomConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %53, ptr noundef %54)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %59

55:                                               ; preds = %38
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %39, i64 noundef 64) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %87

59:                                               ; preds = %42, %32
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %62, label %83

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %63 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #7
  %64 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 9
  %65 = load i32, ptr %64, align 8, !tbaa !30
  invoke void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64) %63, i32 noundef %65)
          to label %66 unwind label %79

66:                                               ; preds = %62
  store ptr %63, ptr %14, align 8, !tbaa !5
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 3
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %68, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store ptr %67, ptr %69, align 8, !tbaa !5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN12MultiplierOS17setLeftConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %70, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = sub nsw i32 %72, 1
  store i32 %73, ptr %16, align 4, !tbaa !9
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %74 = getelementptr inbounds %class.OSMeshMN, ptr %18, i32 0, i32 1
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %74, ptr noundef nonnull align 4 dereferenceable(8) %15)
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  store ptr %76, ptr %17, align 8, !tbaa !5
  %77 = load ptr, ptr %17, align 8, !tbaa !5
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN12MultiplierOS18setRightConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %77, ptr noundef %78)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #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 %83

79:                                               ; preds = %62
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %9, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %63, i64 noundef 64) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %87

83:                                               ; preds = %66, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !9
  br label %26, !llvm.loop !31

87:                                               ; preds = %79, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %93

88:                                               ; preds = %31
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %3, align 4, !tbaa !9
  br label %19, !llvm.loop !33

92:                                               ; preds = %24
  ret void

93:                                               ; preds = %87
  %94 = load ptr, ptr %9, align 8
  %95 = load i32, ptr %10, 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 nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

declare void @_ZN12MultiplierOS16setTopConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) #5

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

declare void @_ZN12MultiplierOS17setLeftConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) #5

declare void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) unnamed_addr #5

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

declare void @_ZN12MultiplierOS19setBottomConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) #5

declare void @_ZN12MultiplierOS18setRightConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin 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 #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 = { 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 = { "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) }
attributes #8 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 240}
!12 = !{!"_ZTS8OSMeshMN", !13, i64 0, !18, i64 48, !26, i64 96, !26, i64 144, !26, i64 192, !10, i64 240, !10, i64 244, !10, i64 248, !10, i64 252, !10, i64 256}
!13 = !{!"_ZTS17MultiplierNetwork", !14, i64 0}
!14 = !{!"_ZTS4Unit", !10, i64 8, !15, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEE", !19, i64 0}
!19 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES0_IKS1_P12MultiplierOSESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !20, i64 0}
!20 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES0_IKS1_P12MultiplierOSESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !21, i64 0, !23, i64 8}
!21 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !22, i64 0}
!22 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!23 = !{!"_ZTSSt15_Rb_tree_header", !24, i64 0, !17, i64 32}
!24 = !{!"_ZTSSt18_Rb_tree_node_base", !25, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!26 = !{!"_ZTSSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES0_IKS1_P10ConnectionESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES0_IKS1_P10ConnectionESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !21, i64 0, !23, i64 8}
!29 = !{!12, !10, i64 244}
!30 = !{!12, !10, i64 256}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::pair" = type { i32, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8OSMeshMN21setPhysicalConnectionEv(ptr noundef nonnull align 8 dereferenceable(260) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 240
  store i32 0, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %._crit_edge18, label %.lr.ph17

.lr.ph17:                                         ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 244
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = getelementptr inbounds i8, ptr %0, i64 256
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = getelementptr inbounds i8, ptr %0, i64 144
  %16 = load i32, ptr %11, align 4, !tbaa !28
  %.not20 = icmp eq i32 %16, 0
  br i1 %.not20, label %._crit_edge18, label %.lr.ph17.split

._crit_edge18:                                    ; preds = %._crit_edge, %.lr.ph17, %1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret void

.lr.ph17.split:                                   ; preds = %.lr.ph17, %._crit_edge
  %17 = phi i32 [ %20, %._crit_edge ], [ %10, %.lr.ph17 ]
  %18 = phi i32 [ %23, %._crit_edge ], [ 0, %.lr.ph17 ]
  %19 = phi i32 [ %22, %._crit_edge ], [ 1, %.lr.ph17 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %.not21 = icmp eq i32 %19, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %54
  %.pre24 = load i32, ptr %2, align 4, !tbaa !5
  %.pre25 = load i32, ptr %9, align 8, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph17.split
  %20 = phi i32 [ %.pre25, %._crit_edge.loopexit ], [ %17, %.lr.ph17.split ]
  %21 = phi i32 [ %.pre24, %._crit_edge.loopexit ], [ %18, %.lr.ph17.split ]
  %22 = phi i32 [ %57, %._crit_edge.loopexit ], [ 0, %.lr.ph17.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %23 = add nsw i32 %21, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  %24 = icmp ult i32 %23, %20
  br i1 %24, label %.lr.ph17.split, label %._crit_edge18, !llvm.loop !29

.lr.ph:                                           ; preds = %.lr.ph17.split, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %26 = load ptr, ptr %25, align 8, !tbaa !32
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %40

29:                                               ; preds = %.lr.ph
  %30 = call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #7
  %31 = load i32, ptr %13, align 8, !tbaa !33
  invoke void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64) %30, i32 noundef %31)
          to label %32 unwind label %38

32:                                               ; preds = %29
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store ptr %30, ptr %33, align 8, !tbaa !32
  call void @_ZN12MultiplierOS16setTopConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %26, ptr noundef nonnull %30)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %6, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %37 = load ptr, ptr %36, align 8, !tbaa !32
  call void @_ZN12MultiplierOS19setBottomConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %37, ptr noundef nonnull %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %40

38:                                               ; preds = %29
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %59

40:                                               ; preds = %32, %.lr.ph
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %54

43:                                               ; preds = %40
  %44 = call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #7
  %45 = load i32, ptr %13, align 8, !tbaa !33
  invoke void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64) %44, i32 noundef %45)
          to label %46 unwind label %52

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store ptr %44, ptr %47, align 8, !tbaa !32
  call void @_ZN12MultiplierOS17setLeftConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %26, ptr noundef nonnull %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %8, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %51 = load ptr, ptr %50, align 8, !tbaa !32
  call void @_ZN12MultiplierOS18setRightConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222) %51, ptr noundef nonnull %44)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %54

52:                                               ; preds = %43
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %59

54:                                               ; preds = %46, %40
  %55 = phi i32 [ %.pre, %46 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !28
  %58 = icmp ult i32 %56, %57
  br i1 %58, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !34

59:                                               ; preds = %52, %38
  %.lcssa26.sink = phi ptr [ %44, %52 ], [ %30, %38 ]
  %.pn = phi { ptr, i32 } [ %53, %52 ], [ %39, %38 ]
  call void @_ZdlPvm(ptr noundef nonnull %.lcssa26.sink, i64 noundef 64) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn
}

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

declare void @_ZN12MultiplierOS16setTopConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) local_unnamed_addr #5

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

declare void @_ZN12MultiplierOS17setLeftConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) local_unnamed_addr #5

declare void @_ZN10ConnectionC1Ei(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

declare void @_ZN12MultiplierOS19setBottomConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) local_unnamed_addr #5

declare void @_ZN12MultiplierOS18setRightConnectionEP10Connection(ptr noundef nonnull align 8 dereferenceable(222), ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin 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 #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 = { 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 = { "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) }
attributes #8 = { builtin 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, !6, i64 240}
!10 = !{!"_ZTS8OSMeshMN", !11, i64 0, !17, i64 48, !25, i64 96, !25, i64 144, !25, i64 192, !6, i64 240, !6, i64 244, !6, i64 248, !6, i64 252, !6, i64 256}
!11 = !{!"_ZTS17MultiplierNetwork", !12, i64 0}
!12 = !{!"_ZTS4Unit", !6, i64 8, !13, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !16, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSSt3mapISt4pairIiiEP12MultiplierOSSt4lessIS1_ESaIS0_IKS1_S3_EEE", !18, i64 0}
!18 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES0_IKS1_P12MultiplierOSESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !19, i64 0}
!19 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES0_IKS1_P12MultiplierOSESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !20, i64 0, !22, i64 8}
!20 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !21, i64 0}
!21 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!22 = !{!"_ZTSSt15_Rb_tree_header", !23, i64 0, !16, i64 32}
!23 = !{!"_ZTSSt18_Rb_tree_node_base", !24, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!24 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!25 = !{!"_ZTSSt3mapISt4pairIiiEP10ConnectionSt4lessIS1_ESaIS0_IKS1_S3_EEE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES0_IKS1_P10ConnectionESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES0_IKS1_P10ConnectionESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !20, i64 0, !22, i64 8}
!28 = !{!10, !6, i64 244}
!29 = distinct !{!29, !30, !31}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = !{!15, !15, i64 0}
!33 = !{!10, !6, i64 256}
!34 = distinct !{!34, !30}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass