; LLVM IR from Leet-Us-Code/DSA-A-Z-Practice :: Sid's Levels/Level - 1/Arrays&2DArrays/UnionOfTwoSortedArrays.ll (Z9findUnionPiS_ii)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9findUnionPiS_ii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::unordered_set", align 8
  %14 = alloca i1, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #4
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  store i1 false, ptr %14, align 1
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %143, %5
  %18 = load i32, ptr %11, align 4, !tbaa !9
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %25

21:                                               ; preds = %17
  %22 = load i32, ptr %12, align 4, !tbaa !9
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp slt i32 %22, %23
  br label %25

25:                                               ; preds = %21, %17
  %26 = phi i1 [ false, %17 ], [ %24, %21 ]
  br i1 %26, label %27, label %144

27:                                               ; preds = %25
  br label %28

28:                                               ; preds = %48, %27
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = sub nsw i32 %30, 1
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %33, label %46

33:                                               ; preds = %28
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %34, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %39, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = icmp eq i32 %38, %44
  br label %46

46:                                               ; preds = %33, %28
  %47 = phi i1 [ false, %28 ], [ %45, %33 ]
  br i1 %47, label %48, label %51

48:                                               ; preds = %46
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %11, align 4, !tbaa !9
  br label %28, !llvm.loop !11

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %72, %51
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = sub nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %57, label %70

57:                                               ; preds = %52
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %63, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = icmp eq i32 %62, %68
  br label %70

70:                                               ; preds = %57, %52
  %71 = phi i1 [ false, %52 ], [ %69, %57 ]
  br i1 %71, label %72, label %75

72:                                               ; preds = %70
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %12, align 4, !tbaa !9
  br label %52, !llvm.loop !13

75:                                               ; preds = %70
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = icmp sgt i32 %80, %85
  br i1 %86, label %87, label %99

87:                                               ; preds = %75
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %91)
          to label %92 unwind label %95

92:                                               ; preds = %87
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %12, align 4, !tbaa !9
  br label %143

95:                                               ; preds = %210, %173, %131, %111, %87
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %15, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %16, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %222

99:                                               ; preds = %75
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = icmp sgt i32 %104, %109
  br i1 %110, label %111, label %119

111:                                              ; preds = %99
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %115)
          to label %116 unwind label %95

116:                                              ; preds = %111
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %11, align 4, !tbaa !9
  br label %142

119:                                              ; preds = %99
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %120, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = icmp eq i32 %124, %129
  br i1 %130, label %131, label %141

131:                                              ; preds = %119
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr %132, i64 %134
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %135)
          to label %136 unwind label %95

136:                                              ; preds = %131
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %11, align 4, !tbaa !9
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %12, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %136, %119
  br label %142

142:                                              ; preds = %141, %116
  br label %143

143:                                              ; preds = %142, %92
  br label %17, !llvm.loop !14

144:                                              ; preds = %25
  br label %145

145:                                              ; preds = %178, %144
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %149, label %181

149:                                              ; preds = %145
  br label %150

150:                                              ; preds = %170, %149
  %151 = load i32, ptr %11, align 4, !tbaa !9
  %152 = load i32, ptr %9, align 4, !tbaa !9
  %153 = sub nsw i32 %152, 1
  %154 = icmp slt i32 %151, %153
  br i1 %154, label %155, label %168

155:                                              ; preds = %150
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr %156, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !9
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = load i32, ptr %11, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i32, ptr %161, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = icmp eq i32 %160, %166
  br label %168

168:                                              ; preds = %155, %150
  %169 = phi i1 [ false, %150 ], [ %167, %155 ]
  br i1 %169, label %170, label %173

170:                                              ; preds = %168
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %11, align 4, !tbaa !9
  br label %150, !llvm.loop !15

173:                                              ; preds = %168
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %174, i64 %176
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %177)
          to label %178 unwind label %95

178:                                              ; preds = %173
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !9
  br label %145, !llvm.loop !16

181:                                              ; preds = %145
  br label %182

182:                                              ; preds = %215, %181
  %183 = load i32, ptr %12, align 4, !tbaa !9
  %184 = load i32, ptr %10, align 4, !tbaa !9
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %186, label %218

186:                                              ; preds = %182
  br label %187

187:                                              ; preds = %207, %186
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = load i32, ptr %10, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = icmp slt i32 %188, %190
  br i1 %191, label %192, label %205

192:                                              ; preds = %187
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds i32, ptr %193, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !9
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = load i32, ptr %12, align 4, !tbaa !9
  %200 = add nsw i32 %199, 1
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i32, ptr %198, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !9
  %204 = icmp eq i32 %197, %203
  br label %205

205:                                              ; preds = %192, %187
  %206 = phi i1 [ false, %187 ], [ %204, %192 ]
  br i1 %206, label %207, label %210

207:                                              ; preds = %205
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %12, align 4, !tbaa !9
  br label %187, !llvm.loop !17

210:                                              ; preds = %205
  %211 = load ptr, ptr %8, align 8, !tbaa !5
  %212 = load i32, ptr %12, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds i32, ptr %211, i64 %213
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %214)
          to label %215 unwind label %95

215:                                              ; preds = %210
  %216 = load i32, ptr %12, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %12, align 4, !tbaa !9
  br label %182, !llvm.loop !18

218:                                              ; preds = %182
  store i1 true, ptr %14, align 1
  %219 = load i1, ptr %14, align 1
  br i1 %219, label %221, label %220

220:                                              ; preds = %218
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %221

221:                                              ; preds = %220, %218
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void

222:                                              ; preds = %95
  %223 = load ptr, ptr %15, align 8
  %224 = load i32, ptr %16, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9findUnionPiS_ii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::unordered_set", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #5
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %7 = icmp sgt i32 %3, 0
  %8 = icmp sgt i32 %4, 0
  %9 = and i1 %7, %8
  br i1 %9, label %.preheader85.lr.ph, label %.preheader81

.preheader85.lr.ph:                               ; preds = %5
  %10 = add nsw i32 %3, -1
  %11 = add nsw i32 %4, -1
  %12 = zext nneg i32 %10 to i64
  %13 = zext nneg i32 %11 to i64
  br label %.preheader85

.preheader85:                                     ; preds = %.preheader85.lr.ph, %58
  %.089 = phi i32 [ 0, %.preheader85.lr.ph ], [ %.2, %58 ]
  %.07288 = phi i32 [ 0, %.preheader85.lr.ph ], [ %.274, %58 ]
  %14 = sext i32 %.089 to i64
  %smax = call i32 @llvm.smax.i32(i32 %.089, i32 %10)
  br label %18

.preheader81:                                     ; preds = %58, %5
  %.072.lcssa = phi i32 [ 0, %5 ], [ %.274, %58 ]
  %.0.lcssa = phi i32 [ 0, %5 ], [ %.2, %58 ]
  %15 = icmp slt i32 %.0.lcssa, %3
  br i1 %15, label %.preheader80.lr.ph, label %.preheader79

.preheader80.lr.ph:                               ; preds = %.preheader81
  %16 = add nsw i32 %3, -1
  %17 = sext i32 %16 to i64
  br label %.preheader80

18:                                               ; preds = %.preheader85, %20
  %indvars.iv = phi i64 [ %14, %.preheader85 ], [ %indvars.iv.next, %20 ]
  %19 = icmp slt i64 %indvars.iv, %12
  br i1 %19, label %20, label %.critedge

20:                                               ; preds = %18
  %21 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %23 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = icmp eq i32 %22, %24
  br i1 %25, label %18, label %.critedge.split.loop.exit106, !llvm.loop !9

.critedge.split.loop.exit106:                     ; preds = %20
  %26 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %18, %.critedge.split.loop.exit106
  %.1.lcssa = phi i32 [ %26, %.critedge.split.loop.exit106 ], [ %smax, %18 ]
  %27 = sext i32 %.07288 to i64
  %smax96 = call i32 @llvm.smax.i32(i32 %.07288, i32 %11)
  br label %28

28:                                               ; preds = %30, %.critedge
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %30 ], [ %27, %.critedge ]
  %29 = icmp slt i64 %indvars.iv94, %13
  br i1 %29, label %30, label %.critedge2

30:                                               ; preds = %28
  %31 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv94
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, 1
  %33 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next95
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp eq i32 %32, %34
  br i1 %35, label %28, label %.critedge2.split.loop.exit108, !llvm.loop !11

.critedge2.split.loop.exit108:                    ; preds = %30
  %36 = trunc nsw i64 %indvars.iv94 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %28, %.critedge2.split.loop.exit108
  %.173.lcssa = phi i32 [ %36, %.critedge2.split.loop.exit108 ], [ %smax96, %28 ]
  %37 = sext i32 %.1.lcssa to i64
  %38 = getelementptr inbounds i32, ptr %1, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %.173.lcssa to i64
  %41 = getelementptr inbounds i32, ptr %2, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp sgt i32 %39, %42
  br i1 %43, label %44, label %47

44:                                               ; preds = %.critedge2
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %45 unwind label %.loopexit.split-lp.loopexit.split-lp

45:                                               ; preds = %44
  %46 = add nsw i32 %.173.lcssa, 1
  br label %58

.loopexit:                                        ; preds = %.critedge6
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.critedge4
  %lpad.loopexit82 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %54, %49, %44
  %lpad.loopexit.split-lp83 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit82, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp83, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #5
  resume { ptr, i32 } %lpad.phi

47:                                               ; preds = %.critedge2
  %48 = icmp sgt i32 %42, %39
  br i1 %48, label %49, label %52

49:                                               ; preds = %47
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %38)
          to label %50 unwind label %.loopexit.split-lp.loopexit.split-lp

50:                                               ; preds = %49
  %51 = add nsw i32 %.1.lcssa, 1
  br label %58

52:                                               ; preds = %47
  %53 = icmp eq i32 %42, %39
  br i1 %53, label %54, label %58

54:                                               ; preds = %52
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %38)
          to label %55 unwind label %.loopexit.split-lp.loopexit.split-lp

55:                                               ; preds = %54
  %56 = add nsw i32 %.1.lcssa, 1
  %57 = add nsw i32 %.173.lcssa, 1
  br label %58

58:                                               ; preds = %50, %55, %52, %45
  %.274 = phi i32 [ %46, %45 ], [ %.173.lcssa, %50 ], [ %57, %55 ], [ %.173.lcssa, %52 ]
  %.2 = phi i32 [ %.1.lcssa, %45 ], [ %51, %50 ], [ %56, %55 ], [ %.1.lcssa, %52 ]
  %59 = icmp slt i32 %.2, %3
  %60 = icmp slt i32 %.274, %4
  %61 = select i1 %59, i1 %60, i1 false
  br i1 %61, label %.preheader85, label %.preheader81, !llvm.loop !12

.preheader80:                                     ; preds = %.preheader80.lr.ph, %77
  %.391 = phi i32 [ %.0.lcssa, %.preheader80.lr.ph ], [ %78, %77 ]
  %62 = sext i32 %.391 to i64
  %smax100 = call i32 @llvm.smax.i32(i32 %.391, i32 %16)
  br label %66

.preheader79:                                     ; preds = %77, %.preheader81
  %63 = icmp slt i32 %.072.lcssa, %4
  br i1 %63, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %.preheader79
  %64 = add nsw i32 %4, -1
  %65 = sext i32 %64 to i64
  br label %.preheader

66:                                               ; preds = %.preheader80, %68
  %indvars.iv98 = phi i64 [ %62, %.preheader80 ], [ %indvars.iv.next99, %68 ]
  %67 = icmp slt i64 %indvars.iv98, %17
  br i1 %67, label %68, label %.critedge4

68:                                               ; preds = %66
  %69 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv98
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, 1
  %71 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next99
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %70, %72
  br i1 %73, label %66, label %.critedge4.split.loop.exit110, !llvm.loop !13

.critedge4.split.loop.exit110:                    ; preds = %68
  %74 = trunc nsw i64 %indvars.iv98 to i32
  br label %.critedge4

.critedge4:                                       ; preds = %66, %.critedge4.split.loop.exit110
  %.4.lcssa = phi i32 [ %74, %.critedge4.split.loop.exit110 ], [ %smax100, %66 ]
  %75 = sext i32 %.4.lcssa to i64
  %76 = getelementptr inbounds i32, ptr %1, i64 %75
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %76)
          to label %77 unwind label %.loopexit.split-lp.loopexit

77:                                               ; preds = %.critedge4
  %78 = add nsw i32 %.4.lcssa, 1
  %79 = icmp slt i32 %78, %3
  br i1 %79, label %.preheader80, label %.preheader79, !llvm.loop !14

.preheader:                                       ; preds = %.preheader.lr.ph, %92
  %.37592 = phi i32 [ %.072.lcssa, %.preheader.lr.ph ], [ %93, %92 ]
  %80 = sext i32 %.37592 to i64
  %smax104 = call i32 @llvm.smax.i32(i32 %.37592, i32 %64)
  br label %81

81:                                               ; preds = %.preheader, %83
  %indvars.iv102 = phi i64 [ %80, %.preheader ], [ %indvars.iv.next103, %83 ]
  %82 = icmp slt i64 %indvars.iv102, %65
  br i1 %82, label %83, label %.critedge6

83:                                               ; preds = %81
  %84 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv102
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %indvars.iv.next103 = add nsw i64 %indvars.iv102, 1
  %86 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next103
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = icmp eq i32 %85, %87
  br i1 %88, label %81, label %.critedge6.split.loop.exit112, !llvm.loop !15

.critedge6.split.loop.exit112:                    ; preds = %83
  %89 = trunc nsw i64 %indvars.iv102 to i32
  br label %.critedge6

.critedge6:                                       ; preds = %81, %.critedge6.split.loop.exit112
  %.476.lcssa = phi i32 [ %89, %.critedge6.split.loop.exit112 ], [ %smax104, %81 ]
  %90 = sext i32 %.476.lcssa to i64
  %91 = getelementptr inbounds i32, ptr %2, i64 %90
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %91)
          to label %92 unwind label %.loopexit

92:                                               ; preds = %.critedge6
  %93 = add nsw i32 %.476.lcssa, 1
  %94 = icmp slt i32 %93, %4
  br i1 %94, label %.preheader, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %92, %.preheader79
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #5
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

attributes #0 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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