; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/cp/Intersection_Point_of_Y_shaped_LinkedList.ll (Z9Intersectv)

; 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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"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::allocator" = type { i8 }
%class.Node = type { i32, ptr, ptr }

@head1 = external dso_local global ptr, align 8
@head2 = external dso_local global ptr, align 8
@temp1 = external dso_local global ptr, align 8
@temp2 = external dso_local global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.13 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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)) #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Intersectv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %10 unwind label %22

10:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  %11 = load ptr, ptr @head1, align 8, !tbaa !9
  store ptr %11, ptr @temp1, align 8, !tbaa !9
  %12 = load ptr, ptr @head2, align 8, !tbaa !9
  store ptr %12, ptr @temp2, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %16, %10
  %14 = load ptr, ptr @temp1, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %26

16:                                               ; preds = %13
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %1, align 4, !tbaa !5
  %19 = load ptr, ptr @temp1, align 8, !tbaa !9
  %20 = getelementptr inbounds %class.Node, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  store ptr %21, ptr @temp1, align 8, !tbaa !9
  br label %13, !llvm.loop !13

22:                                               ; preds = %0
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %5, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %176

26:                                               ; preds = %13
  br label %27

27:                                               ; preds = %30, %26
  %28 = load ptr, ptr @temp2, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %36

30:                                               ; preds = %27
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  %33 = load ptr, ptr @temp2, align 8, !tbaa !9
  %34 = getelementptr inbounds %class.Node, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  store ptr %35, ptr @temp2, align 8, !tbaa !9
  br label %27, !llvm.loop !16

36:                                               ; preds = %27
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp sgt i32 %37, %38
  br i1 %39, label %40, label %47

40:                                               ; preds = %36
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @.str.14)
          to label %42 unwind label %43

42:                                               ; preds = %40
  br label %50

43:                                               ; preds = %72, %70, %68, %66, %64, %62, %60, %58, %56, %54, %52, %50, %47, %40
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  br label %175

47:                                               ; preds = %36
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @.str.15)
          to label %49 unwind label %43

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49, %42
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.16)
          to label %52 unwind label %43

52:                                               ; preds = %50
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %54 unwind label %43

54:                                               ; preds = %52
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.17)
          to label %56 unwind label %43

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %58 unwind label %43

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @.str.18)
          to label %60 unwind label %43

60:                                               ; preds = %58
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %62 unwind label %43

62:                                               ; preds = %60
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.19)
          to label %64 unwind label %43

64:                                               ; preds = %62
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %66 unwind label %43

66:                                               ; preds = %64
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef @.str.20)
          to label %68 unwind label %43

68:                                               ; preds = %66
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %70 unwind label %43

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.16)
          to label %72 unwind label %43

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %74 unwind label %43

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.21)
          to label %76 unwind label %94

76:                                               ; preds = %74
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %78 unwind label %94

78:                                               ; preds = %76
  %79 = load ptr, ptr @head1, align 8, !tbaa !9
  store ptr %79, ptr @temp1, align 8, !tbaa !9
  %80 = load ptr, ptr @head2, align 8, !tbaa !9
  store ptr %80, ptr @temp2, align 8, !tbaa !9
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = icmp sgt i32 %81, %82
  br i1 %83, label %84, label %131

84:                                               ; preds = %78
  br label %85

85:                                               ; preds = %90, %84
  %86 = load ptr, ptr @temp2, align 8, !tbaa !9
  %87 = getelementptr inbounds %class.Node, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !15
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %98

90:                                               ; preds = %85
  %91 = load ptr, ptr @temp2, align 8, !tbaa !9
  %92 = getelementptr inbounds %class.Node, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  store ptr %93, ptr @temp2, align 8, !tbaa !9
  br label %85, !llvm.loop !17

94:                                               ; preds = %171, %169, %128, %126, %76, %74
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %5, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %175

98:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %109, %98
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = icmp slt i32 %100, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %112

105:                                              ; preds = %99
  %106 = load ptr, ptr @temp1, align 8, !tbaa !9
  %107 = getelementptr inbounds %class.Node, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !11
  store ptr %108, ptr @temp1, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %105
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %8, align 4, !tbaa !5
  br label %99, !llvm.loop !18

112:                                              ; preds = %104
  br label %113

113:                                              ; preds = %116, %112
  %114 = load ptr, ptr @temp1, align 8, !tbaa !9
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %126

116:                                              ; preds = %113
  %117 = load ptr, ptr @temp1, align 8, !tbaa !9
  %118 = load ptr, ptr @temp2, align 8, !tbaa !9
  %119 = getelementptr inbounds %class.Node, ptr %118, i32 0, i32 2
  store ptr %117, ptr %119, align 8, !tbaa !15
  %120 = load ptr, ptr @temp1, align 8, !tbaa !9
  %121 = getelementptr inbounds %class.Node, ptr %120, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  store ptr %122, ptr @temp1, align 8, !tbaa !9
  %123 = load ptr, ptr @temp2, align 8, !tbaa !9
  %124 = getelementptr inbounds %class.Node, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !15
  store ptr %125, ptr @temp2, align 8, !tbaa !9
  br label %113, !llvm.loop !19

126:                                              ; preds = %113
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.22)
          to label %128 unwind label %94

128:                                              ; preds = %126
  %129 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %130 unwind label %94

130:                                              ; preds = %128
  br label %174

131:                                              ; preds = %78
  br label %132

132:                                              ; preds = %137, %131
  %133 = load ptr, ptr @temp1, align 8, !tbaa !9
  %134 = getelementptr inbounds %class.Node, ptr %133, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !11
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %141

137:                                              ; preds = %132
  %138 = load ptr, ptr @temp1, align 8, !tbaa !9
  %139 = getelementptr inbounds %class.Node, ptr %138, i32 0, i32 1
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  store ptr %140, ptr @temp1, align 8, !tbaa !9
  br label %132, !llvm.loop !20

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

142:                                              ; preds = %152, %141
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = icmp slt i32 %143, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %155

148:                                              ; preds = %142
  %149 = load ptr, ptr @temp2, align 8, !tbaa !9
  %150 = getelementptr inbounds %class.Node, ptr %149, i32 0, i32 2
  %151 = load ptr, ptr %150, align 8, !tbaa !15
  store ptr %151, ptr @temp2, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %148
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %9, align 4, !tbaa !5
  br label %142, !llvm.loop !21

155:                                              ; preds = %147
  br label %156

156:                                              ; preds = %159, %155
  %157 = load ptr, ptr @temp2, align 8, !tbaa !9
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %169

159:                                              ; preds = %156
  %160 = load ptr, ptr @temp2, align 8, !tbaa !9
  %161 = load ptr, ptr @temp1, align 8, !tbaa !9
  %162 = getelementptr inbounds %class.Node, ptr %161, i32 0, i32 1
  store ptr %160, ptr %162, align 8, !tbaa !11
  %163 = load ptr, ptr @temp1, align 8, !tbaa !9
  %164 = getelementptr inbounds %class.Node, ptr %163, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  store ptr %165, ptr @temp1, align 8, !tbaa !9
  %166 = load ptr, ptr @temp2, align 8, !tbaa !9
  %167 = getelementptr inbounds %class.Node, ptr %166, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !15
  store ptr %168, ptr @temp2, align 8, !tbaa !9
  br label %156, !llvm.loop !22

169:                                              ; preds = %156
  %170 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.22)
          to label %171 unwind label %94

171:                                              ; preds = %169
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %173 unwind label %94

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void

175:                                              ; preds = %94, %43
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %176

176:                                              ; preds = %175, %22
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr %5, align 8
  %179 = load i32, ptr %6, align 4
  %180 = insertvalue { ptr, i32 } poison, ptr %178, 0
  %181 = insertvalue { ptr, i32 } %180, i32 %179, 1
  resume { ptr, i32 } %181
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !10, i64 8}
!12 = !{!"_ZTS4Node", !6, i64 0, !10, i64 8, !10, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !10, i64 16}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


; 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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"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::allocator" = type { i8 }

@head1 = external dso_local local_unnamed_addr global ptr, align 8
@head2 = external dso_local local_unnamed_addr global ptr, align 8
@temp1 = external dso_local local_unnamed_addr global ptr, align 8
@temp2 = external dso_local local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.13 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1

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

; 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 #1

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Intersectv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %4 unwind label %11

4:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  %5 = load ptr, ptr @head1, align 8, !tbaa !5
  store ptr %5, ptr @temp1, align 8, !tbaa !5
  %6 = load ptr, ptr @head2, align 8, !tbaa !5
  store ptr %6, ptr @temp2, align 8, !tbaa !5
  %.not37 = icmp eq ptr %5, null
  br i1 %.not37, label %thread-pre-split, label %.lr.ph

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.01638 = phi i32 [ %8, %.lr.ph ], [ 0, %4 ]
  %7 = phi ptr [ %10, %.lr.ph ], [ %5, %4 ]
  %8 = add nuw nsw i32 %.01638, 1
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %.thread-pre-split_crit_edge, label %.lr.ph, !llvm.loop !12

11:                                               ; preds = %0
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  br label %129

.thread-pre-split_crit_edge:                      ; preds = %.lr.ph
  store ptr null, ptr @temp1, align 8, !tbaa !5
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %.thread-pre-split_crit_edge, %4
  %.016.lcssa = phi i32 [ %8, %.thread-pre-split_crit_edge ], [ 0, %4 ]
  %.not2339 = icmp eq ptr %6, null
  br i1 %.not2339, label %.invoke, label %.lr.ph41

.lr.ph41:                                         ; preds = %thread-pre-split, %.lr.ph41
  %.01540 = phi i32 [ %14, %.lr.ph41 ], [ 0, %thread-pre-split ]
  %13 = phi ptr [ %16, %.lr.ph41 ], [ %6, %thread-pre-split ]
  %14 = add nuw nsw i32 %.01540, 1
  %15 = getelementptr inbounds i8, ptr %13, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %.not23 = icmp eq ptr %16, null
  br i1 %.not23, label %._crit_edge, label %.lr.ph41, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph41
  store ptr null, ptr @temp2, align 8, !tbaa !5
  br label %.invoke

.invoke:                                          ; preds = %._crit_edge, %thread-pre-split
  %.015.lcssa = phi i32 [ %14, %._crit_edge ], [ 0, %thread-pre-split ]
  %17 = icmp ugt i32 %.016.lcssa, %.015.lcssa
  %18 = select i1 %17, ptr @.str.14, ptr @.str.15
  %19 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %18)
          to label %22 unwind label %20

20:                                               ; preds = %.invoke, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %128

22:                                               ; preds = %.invoke
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
          to label %24 unwind label %20

24:                                               ; preds = %22
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %26 unwind label %20

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.17)
          to label %28 unwind label %20

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %30 unwind label %20

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull @.str.18)
          to label %32 unwind label %20

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %34 unwind label %20

34:                                               ; preds = %32
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.19)
          to label %36 unwind label %20

36:                                               ; preds = %34
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %38 unwind label %20

38:                                               ; preds = %36
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str.20)
          to label %40 unwind label %20

40:                                               ; preds = %38
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %42 unwind label %20

42:                                               ; preds = %40
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
          to label %44 unwind label %20

44:                                               ; preds = %42
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %46 unwind label %20

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.21)
          to label %48 unwind label %65

48:                                               ; preds = %46
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %50 unwind label %65

50:                                               ; preds = %48
  %51 = load ptr, ptr @head1, align 8, !tbaa !5
  store ptr %51, ptr @temp1, align 8, !tbaa !5
  %52 = load ptr, ptr @head2, align 8, !tbaa !5
  store ptr %52, ptr @temp2, align 8, !tbaa !5
  br i1 %17, label %.preheader34, label %.preheader36

.preheader36:                                     ; preds = %50
  %53 = getelementptr inbounds i8, ptr %51, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %.not2444 = icmp eq ptr %54, null
  br i1 %.not2444, label %.preheader35, label %.lr.ph45

.preheader34:                                     ; preds = %50
  %55 = getelementptr inbounds i8, ptr %52, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %.not2657 = icmp eq ptr %56, null
  br i1 %.not2657, label %.preheader, label %.lr.ph58

..preheader_crit_edge:                            ; preds = %.lr.ph58
  store ptr %62, ptr @temp2, align 8, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %..preheader_crit_edge, %.preheader34
  %temp2.promoted64 = phi ptr [ %62, %..preheader_crit_edge ], [ %52, %.preheader34 ]
  %57 = load i32, ptr %3, align 4, !tbaa !16
  %58 = icmp sgt i32 %57, 1
  br i1 %58, label %.lr.ph62.preheader, label %thread-pre-split30

.lr.ph62.preheader:                               ; preds = %.preheader
  %59 = add nsw i32 %57, -2
  %60 = add nsw i32 %57, -1
  %xtraiter112 = and i32 %60, 7
  %61 = icmp ult i32 %59, 7
  br i1 %61, label %.thread-pre-split30_crit_edge.unr-lcssa, label %.lr.ph62.preheader.new

.lr.ph62.preheader.new:                           ; preds = %.lr.ph62.preheader
  %unroll_iter117 = and i32 %60, -8
  br label %.lr.ph62

.lr.ph58:                                         ; preds = %.preheader34, %.lr.ph58
  %62 = phi ptr [ %64, %.lr.ph58 ], [ %56, %.preheader34 ]
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load ptr, ptr %63, align 8, !tbaa !14
  %.not26 = icmp eq ptr %64, null
  br i1 %.not26, label %..preheader_crit_edge, label %.lr.ph58, !llvm.loop !17

65:                                               ; preds = %.invoke94, %.invoke93, %48, %46
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %128

.lr.ph62:                                         ; preds = %.lr.ph62, %.lr.ph62.preheader.new
  %67 = phi ptr [ %51, %.lr.ph62.preheader.new ], [ %83, %.lr.ph62 ]
  %niter118 = phi i32 [ 0, %.lr.ph62.preheader.new ], [ %niter118.next.7, %.lr.ph62 ]
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %77, i64 8
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %81, i64 8
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %niter118.next.7 = add i32 %niter118, 8
  %niter118.ncmp.7 = icmp eq i32 %niter118.next.7, %unroll_iter117
  br i1 %niter118.ncmp.7, label %.thread-pre-split30_crit_edge.unr-lcssa, label %.lr.ph62, !llvm.loop !18

.thread-pre-split30_crit_edge.unr-lcssa:          ; preds = %.lr.ph62, %.lr.ph62.preheader
  %.lcssa103.ph = phi ptr [ poison, %.lr.ph62.preheader ], [ %83, %.lr.ph62 ]
  %.unr114 = phi ptr [ %51, %.lr.ph62.preheader ], [ %83, %.lr.ph62 ]
  %lcmp.mod115.not = icmp eq i32 %xtraiter112, 0
  br i1 %lcmp.mod115.not, label %.thread-pre-split30_crit_edge, label %.lr.ph62.epil

.lr.ph62.epil:                                    ; preds = %.thread-pre-split30_crit_edge.unr-lcssa, %.lr.ph62.epil
  %84 = phi ptr [ %86, %.lr.ph62.epil ], [ %.unr114, %.thread-pre-split30_crit_edge.unr-lcssa ]
  %epil.iter113 = phi i32 [ %epil.iter113.next, %.lr.ph62.epil ], [ 0, %.thread-pre-split30_crit_edge.unr-lcssa ]
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %epil.iter113.next = add i32 %epil.iter113, 1
  %epil.iter113.cmp.not = icmp eq i32 %epil.iter113.next, %xtraiter112
  br i1 %epil.iter113.cmp.not, label %.thread-pre-split30_crit_edge, label %.lr.ph62.epil, !llvm.loop !19

.thread-pre-split30_crit_edge:                    ; preds = %.lr.ph62.epil, %.thread-pre-split30_crit_edge.unr-lcssa
  %.lcssa103 = phi ptr [ %.lcssa103.ph, %.thread-pre-split30_crit_edge.unr-lcssa ], [ %86, %.lr.ph62.epil ]
  store ptr %.lcssa103, ptr @temp1, align 8, !tbaa !5
  br label %thread-pre-split30

thread-pre-split30:                               ; preds = %.thread-pre-split30_crit_edge, %.preheader
  %.pr31 = phi ptr [ %.lcssa103, %.thread-pre-split30_crit_edge ], [ %51, %.preheader ]
  %.not2765 = icmp eq ptr %.pr31, null
  br i1 %.not2765, label %.invoke94, label %.lr.ph66

.lr.ph66:                                         ; preds = %thread-pre-split30, %.lr.ph66
  %87 = phi ptr [ %91, %.lr.ph66 ], [ %.pr31, %thread-pre-split30 ]
  %88 = phi ptr [ %87, %.lr.ph66 ], [ %temp2.promoted64, %thread-pre-split30 ]
  %89 = getelementptr inbounds i8, ptr %88, i64 16
  store ptr %87, ptr %89, align 8, !tbaa !14
  %90 = getelementptr inbounds i8, ptr %87, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %.not27 = icmp eq ptr %91, null
  br i1 %.not27, label %.invoke94.sink.split, label %.lr.ph66, !llvm.loop !21

..preheader35_crit_edge:                          ; preds = %.lr.ph45
  store ptr %97, ptr @temp1, align 8, !tbaa !5
  br label %.preheader35

.preheader35:                                     ; preds = %..preheader35_crit_edge, %.preheader36
  %temp1.promoted50 = phi ptr [ %97, %..preheader35_crit_edge ], [ %51, %.preheader36 ]
  %92 = load i32, ptr %3, align 4, !tbaa !16
  %93 = icmp sgt i32 %92, 1
  br i1 %93, label %.lr.ph48.preheader, label %thread-pre-split32

.lr.ph48.preheader:                               ; preds = %.preheader35
  %94 = add nsw i32 %92, -2
  %95 = add nsw i32 %92, -1
  %xtraiter = and i32 %95, 7
  %96 = icmp ult i32 %94, 7
  br i1 %96, label %.thread-pre-split32_crit_edge.unr-lcssa, label %.lr.ph48.preheader.new

.lr.ph48.preheader.new:                           ; preds = %.lr.ph48.preheader
  %unroll_iter = and i32 %95, -8
  br label %.lr.ph48

.lr.ph45:                                         ; preds = %.preheader36, %.lr.ph45
  %97 = phi ptr [ %99, %.lr.ph45 ], [ %54, %.preheader36 ]
  %98 = getelementptr inbounds i8, ptr %97, i64 8
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %.not24 = icmp eq ptr %99, null
  br i1 %.not24, label %..preheader35_crit_edge, label %.lr.ph45, !llvm.loop !22

.lr.ph48:                                         ; preds = %.lr.ph48, %.lr.ph48.preheader.new
  %100 = phi ptr [ %52, %.lr.ph48.preheader.new ], [ %116, %.lr.ph48 ]
  %niter = phi i32 [ 0, %.lr.ph48.preheader.new ], [ %niter.next.7, %.lr.ph48 ]
  %101 = getelementptr inbounds i8, ptr %100, i64 16
  %102 = load ptr, ptr %101, align 8, !tbaa !14
  %103 = getelementptr inbounds i8, ptr %102, i64 16
  %104 = load ptr, ptr %103, align 8, !tbaa !14
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = load ptr, ptr %105, align 8, !tbaa !14
  %107 = getelementptr inbounds i8, ptr %106, i64 16
  %108 = load ptr, ptr %107, align 8, !tbaa !14
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %110 = load ptr, ptr %109, align 8, !tbaa !14
  %111 = getelementptr inbounds i8, ptr %110, i64 16
  %112 = load ptr, ptr %111, align 8, !tbaa !14
  %113 = getelementptr inbounds i8, ptr %112, i64 16
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  %116 = load ptr, ptr %115, align 8, !tbaa !14
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.thread-pre-split32_crit_edge.unr-lcssa, label %.lr.ph48, !llvm.loop !23

.thread-pre-split32_crit_edge.unr-lcssa:          ; preds = %.lr.ph48, %.lr.ph48.preheader
  %.lcssa107.ph = phi ptr [ poison, %.lr.ph48.preheader ], [ %116, %.lr.ph48 ]
  %.unr = phi ptr [ %52, %.lr.ph48.preheader ], [ %116, %.lr.ph48 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.thread-pre-split32_crit_edge, label %.lr.ph48.epil

.lr.ph48.epil:                                    ; preds = %.thread-pre-split32_crit_edge.unr-lcssa, %.lr.ph48.epil
  %117 = phi ptr [ %119, %.lr.ph48.epil ], [ %.unr, %.thread-pre-split32_crit_edge.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph48.epil ], [ 0, %.thread-pre-split32_crit_edge.unr-lcssa ]
  %118 = getelementptr inbounds i8, ptr %117, i64 16
  %119 = load ptr, ptr %118, align 8, !tbaa !14
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.thread-pre-split32_crit_edge, label %.lr.ph48.epil, !llvm.loop !24

.thread-pre-split32_crit_edge:                    ; preds = %.lr.ph48.epil, %.thread-pre-split32_crit_edge.unr-lcssa
  %.lcssa107 = phi ptr [ %.lcssa107.ph, %.thread-pre-split32_crit_edge.unr-lcssa ], [ %119, %.lr.ph48.epil ]
  store ptr %.lcssa107, ptr @temp2, align 8, !tbaa !5
  br label %thread-pre-split32

thread-pre-split32:                               ; preds = %.thread-pre-split32_crit_edge, %.preheader35
  %.pr33 = phi ptr [ %.lcssa107, %.thread-pre-split32_crit_edge ], [ %52, %.preheader35 ]
  %.not2551 = icmp eq ptr %.pr33, null
  br i1 %.not2551, label %.invoke94, label %.lr.ph52

.lr.ph52:                                         ; preds = %thread-pre-split32, %.lr.ph52
  %120 = phi ptr [ %124, %.lr.ph52 ], [ %.pr33, %thread-pre-split32 ]
  %121 = phi ptr [ %120, %.lr.ph52 ], [ %temp1.promoted50, %thread-pre-split32 ]
  %122 = getelementptr inbounds i8, ptr %121, i64 8
  store ptr %120, ptr %122, align 8, !tbaa !9
  %123 = getelementptr inbounds i8, ptr %120, i64 16
  %124 = load ptr, ptr %123, align 8, !tbaa !14
  %.not25 = icmp eq ptr %124, null
  br i1 %.not25, label %.invoke94.sink.split, label %.lr.ph52, !llvm.loop !25

.invoke94.sink.split:                             ; preds = %.lr.ph52, %.lr.ph66
  %.lcssa88.sink = phi ptr [ null, %.lr.ph66 ], [ %120, %.lr.ph52 ]
  %.sink = phi ptr [ %87, %.lr.ph66 ], [ null, %.lr.ph52 ]
  store ptr %.lcssa88.sink, ptr @temp1, align 8, !tbaa !5
  store ptr %.sink, ptr @temp2, align 8, !tbaa !5
  br label %.invoke94

.invoke94:                                        ; preds = %.invoke94.sink.split, %thread-pre-split32, %thread-pre-split30
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.22)
          to label %.invoke93 unwind label %65

.invoke93:                                        ; preds = %.invoke94
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %127 unwind label %65

127:                                              ; preds = %.invoke93
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret void

128:                                              ; preds = %65, %20
  %.pn = phi { ptr, i32 } [ %66, %65 ], [ %21, %20 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  br label %129

129:                                              ; preds = %128, %11
  %.pn.pn = phi { ptr, i32 } [ %.pn, %128 ], [ %12, %11 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Node", !11, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !6, i64 16}
!15 = distinct !{!15, !13}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !13}


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