; LLVM IR from huawei-noah/bolt :: common/uni/src/tensor_transpose.ll (Z21array_transpose_naivejPjPKvS_PvS_i)

; 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<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21array_transpose_naivejPjPKvS_PvS_i(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6) #0 personality ptr @__gxx_personality_v0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !5
  %31 = load i32, ptr %14, align 4, !tbaa !5
  %32 = icmp sle i32 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %7
  br label %164

34:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %55, %34
  %36 = load i32, ptr %17, align 4, !tbaa !5
  %37 = load i32, ptr %14, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %58

40:                                               ; preds = %35
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  %42 = load i32, ptr %17, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %41, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %15, align 4, !tbaa !5
  %47 = mul i32 %46, %45
  store i32 %47, ptr %15, align 4, !tbaa !5
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = load i32, ptr %17, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %16, align 4, !tbaa !5
  %54 = mul i32 %53, %52
  store i32 %54, ptr %16, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %40
  %56 = load i32, ptr %17, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %17, align 4, !tbaa !5
  br label %35, !llvm.loop !11

58:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %59 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %59, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %60, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %61 = load i32, ptr %14, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #4
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  invoke void @_ZNSt6vectorIjSaIjEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %62, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %63 unwind label %69

63:                                               ; preds = %58
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %156, %63
  %65 = load i32, ptr %24, align 4, !tbaa !5
  %66 = load i32, ptr %16, align 4, !tbaa !5
  %67 = icmp ult i32 %65, %66
  br i1 %67, label %73, label %68

68:                                               ; preds = %64
  store i32 5, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %163

69:                                               ; preds = %58
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %22, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %23, align 4
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  br label %165

73:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %74 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %74, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %109, %73
  %76 = load i32, ptr %27, align 4, !tbaa !5
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 8, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %112

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %81 = load i32, ptr %26, align 4, !tbaa !5
  %82 = load ptr, ptr %11, align 8, !tbaa !9
  %83 = load i32, ptr %27, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = urem i32 %81, %86
  store i32 %87, ptr %28, align 4, !tbaa !5
  %88 = load ptr, ptr %11, align 8, !tbaa !9
  %89 = load i32, ptr %27, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %26, align 4, !tbaa !5
  %94 = udiv i32 %93, %92
  store i32 %94, ptr %26, align 4, !tbaa !5
  %95 = load i32, ptr %28, align 4, !tbaa !5
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  %98 = load ptr, ptr %13, align 8, !tbaa !9
  %99 = load i32, ptr %14, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = load i32, ptr %27, align 4, !tbaa !5
  %102 = sub nsw i32 %100, %101
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %98, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sub i32 %97, %105
  %107 = zext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %107) #4
  store i32 %95, ptr %108, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  br label %109

109:                                              ; preds = %80
  %110 = load i32, ptr %27, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %27, align 4, !tbaa !5
  br label %75, !llvm.loop !13

112:                                              ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  store i32 %114, ptr %30, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %133, %112
  %116 = load i32, ptr %30, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 11, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %136

119:                                              ; preds = %115
  %120 = load i32, ptr %29, align 4, !tbaa !5
  %121 = load i32, ptr %30, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %122) #4
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = add i32 %120, %124
  %126 = load ptr, ptr %9, align 8, !tbaa !9
  %127 = load i32, ptr %30, align 4, !tbaa !5
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %126, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = mul i32 %125, %131
  store i32 %132, ptr %29, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %119
  %134 = load i32, ptr %30, align 4, !tbaa !5
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr %30, align 4, !tbaa !5
  br label %115, !llvm.loop !14

136:                                              ; preds = %118
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef 0) #4
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %29, align 4, !tbaa !5
  %140 = add i32 %139, %138
  store i32 %140, ptr %29, align 4, !tbaa !5
  %141 = load ptr, ptr %19, align 8, !tbaa !9
  %142 = load i32, ptr %24, align 4, !tbaa !5
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = mul i32 %142, %143
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds i8, ptr %141, i64 %145
  %147 = load ptr, ptr %18, align 8, !tbaa !9
  %148 = load i32, ptr %29, align 4, !tbaa !5
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = mul i32 %148, %149
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %147, i64 %151
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = zext i32 %153 to i64
  invoke void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %146, ptr noundef %152, i64 noundef %154)
          to label %155 unwind label %159

155:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %24, align 4, !tbaa !5
  %158 = add i32 %157, 1
  store i32 %158, ptr %24, align 4, !tbaa !5
  br label %64, !llvm.loop !15

159:                                              ; preds = %136
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %22, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  br label %165

163:                                              ; preds = %68
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %164

164:                                              ; preds = %163, %33
  ret void

165:                                              ; preds = %159, %69
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %22, align 8
  %168 = load i32, ptr %23, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z10UNI_MEMCPYPvPKvm(ptr noundef, ptr noundef, i64 noundef) #3

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

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

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 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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21array_transpose_naivejPjPKvS_PvS_i(i32 noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3, ptr noundef %4, ptr nocapture noundef readonly %5, i32 noundef %6) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = icmp slt i32 %6, 2
  br i1 %10, label %55, label %.preheader59.preheader

.preheader59.preheader:                           ; preds = %7
  %wide.trip.count = zext nneg i32 %6 to i64
  %min.iters.check = icmp ult i32 %6, 8
  br i1 %min.iters.check, label %.preheader59.preheader100, label %vector.ph

.preheader59.preheader100:                        ; preds = %middle.block, %.preheader59.preheader
  %indvars.iv.ph = phi i64 [ 0, %.preheader59.preheader ], [ %n.vec, %middle.block ]
  %.05461.ph = phi i32 [ 1, %.preheader59.preheader ], [ %16, %middle.block ]
  br label %.preheader59

vector.ph:                                        ; preds = %.preheader59.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %13, %vector.body ]
  %vec.phi98 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %14, %vector.body ]
  %11 = getelementptr inbounds i32, ptr %3, i64 %index
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5
  %wide.load99 = load <4 x i32>, ptr %12, align 4, !tbaa !5
  %13 = mul <4 x i32> %wide.load, %vec.phi
  %14 = mul <4 x i32> %wide.load99, %vec.phi98
  %index.next = add nuw i64 %index, 8
  %15 = icmp eq i64 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = mul <4 x i32> %14, %13
  %16 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %.preheader59.preheader100

.loopexit:                                        ; preds = %.preheader59, %middle.block
  %.lcssa97 = phi i32 [ %16, %middle.block ], [ %19, %.preheader59 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorIjSaIjEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %wide.trip.count, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %20 unwind label %52

.preheader59:                                     ; preds = %.preheader59.preheader100, %.preheader59
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader59 ], [ %indvars.iv.ph, %.preheader59.preheader100 ]
  %.05461 = phi i32 [ %19, %.preheader59 ], [ %.05461.ph, %.preheader59.preheader100 ]
  %17 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = mul i32 %18, %.05461
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.preheader59, !llvm.loop !13

20:                                               ; preds = %.loopexit
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  %.not = icmp eq i32 %.lcssa97, 0
  br i1 %.not, label %._crit_edge68, label %.preheader58.us.preheader

.preheader58.us.preheader:                        ; preds = %20
  %21 = add nsw i32 %6, -1
  %invariant.gep = getelementptr i8, ptr %1, i64 -8
  %22 = zext i32 %0 to i64
  %23 = sext i32 %21 to i64
  %wide.trip.count94 = zext i32 %.lcssa97 to i64
  br label %.preheader58.us

.preheader58.us:                                  ; preds = %.preheader58.us.preheader, %34
  %indvars.iv91 = phi i64 [ 0, %.preheader58.us.preheader ], [ %indvars.iv.next92, %34 ]
  %24 = trunc nuw i64 %indvars.iv91 to i32
  br label %41

._crit_edge.us:                                   ; preds = %.lr.ph66.us
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #5
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add i32 %26, %39
  %28 = mul i32 %24, %0
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %4, i64 %29
  %31 = mul i32 %27, %0
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds i8, ptr %2, i64 %32
  invoke void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %30, ptr noundef %33, i64 noundef %22)
          to label %34 unwind label %.split

34:                                               ; preds = %._crit_edge.us
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
  br i1 %exitcond95.not, label %._crit_edge68, label %.preheader58.us, !llvm.loop !14

.lr.ph66.us:                                      ; preds = %41, %.lr.ph66.us
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph66.us ], [ %wide.trip.count, %41 ]
  %.04764.us = phi i32 [ %39, %.lr.ph66.us ], [ 0, %41 ]
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv.next89) #5
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add i32 %36, %.04764.us
  %gep.us = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv88
  %38 = load i32, ptr %gep.us, align 4, !tbaa !5
  %39 = mul i32 %37, %38
  %40 = icmp sgt i64 %indvars.iv88, 2
  br i1 %40, label %.lr.ph66.us, label %._crit_edge.us, !llvm.loop !15

41:                                               ; preds = %.preheader58.us, %41
  %indvars.iv83 = phi i64 [ 0, %.preheader58.us ], [ %indvars.iv.next84, %41 ]
  %.05062.us = phi i32 [ %24, %.preheader58.us ], [ %45, %41 ]
  %42 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv83
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = urem i32 %.05062.us, %43
  %45 = udiv i32 %.05062.us, %43
  %46 = sub nsw i64 %23, %indvars.iv83
  %47 = getelementptr inbounds i32, ptr %5, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sub i32 %21, %48
  %50 = zext i32 %49 to i64
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %50) #5
  store i32 %44, ptr %51, align 4, !tbaa !5
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
  br i1 %exitcond87.not, label %.lr.ph66.us, label %41, !llvm.loop !16

._crit_edge68:                                    ; preds = %34, %20
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %55

52:                                               ; preds = %.loopexit
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  br label %56

.split:                                           ; preds = %._crit_edge.us
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %56

55:                                               ; preds = %7, %._crit_edge68
  ret void

56:                                               ; preds = %.split, %52
  %.pn = phi { ptr, i32 } [ %54, %.split ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  resume { ptr, i32 } %.pn
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z10UNI_MEMCPYPvPKvm(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x 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 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass