; LLVM IR from eyangch/competitive-programming :: USACOtraining/2.1/frac1.ll (Z10isRelPrimeii)

; 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 }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z10isRelPrimeii(i32 noundef %0, i32 noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %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 i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %21)
  %23 = fptosi double %22 to i32
  store i32 %23, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %24)
  %26 = fptosi double %25 to i32
  store i32 %26, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  store i8 0, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  store i8 0, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %52, %2
  %28 = load i32, ptr %12, align 4, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %56

32:                                               ; preds = %27
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %12, align 4, !tbaa !5
  %35 = srem i32 %33, %34
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %51

37:                                               ; preds = %32
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %38 unwind label %43

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %12, align 4, !tbaa !5
  %41 = sdiv i32 %39, %40
  store i32 %41, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %42 unwind label %47

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  store i8 1, ptr %10, align 1, !tbaa !9
  br label %51

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %13, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %14, align 4
  br label %55

47:                                               ; preds = %38
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %13, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %55

51:                                               ; preds = %42, %32
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %12, align 4, !tbaa !5
  br label %27, !llvm.loop !11

55:                                               ; preds = %47, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %155

56:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %82, %56
  %58 = load i32, ptr %16, align 4, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %86

62:                                               ; preds = %57
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = load i32, ptr %16, align 4, !tbaa !5
  %65 = srem i32 %63, %64
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %81

67:                                               ; preds = %62
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %68 unwind label %73

68:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = load i32, ptr %16, align 4, !tbaa !5
  %71 = sdiv i32 %69, %70
  store i32 %71, ptr %17, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %72 unwind label %77

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  store i8 1, ptr %11, align 1, !tbaa !9
  br label %81

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %13, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %14, align 4
  br label %85

77:                                               ; preds = %68
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %85

81:                                               ; preds = %72, %62
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %16, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %16, align 4, !tbaa !5
  br label %57, !llvm.loop !13

85:                                               ; preds = %77, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %155

86:                                               ; preds = %61
  %87 = load i8, ptr %10, align 1, !tbaa !9, !range !14, !noundef !15
  %88 = trunc i8 %87 to i1
  br i1 %88, label %89, label %92

89:                                               ; preds = %86
  %90 = load i8, ptr %11, align 1, !tbaa !9, !range !14, !noundef !15
  %91 = trunc i8 %90 to i1
  br i1 %91, label %96, label %92

92:                                               ; preds = %89, %86
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 1
  br i1 %94, label %95, label %96

95:                                               ; preds = %92
  store i1 false, ptr %3, align 1
  store i32 1, ptr %18, align 4
  br label %153

96:                                               ; preds = %92, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %147, %96
  %98 = load i32, ptr %19, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %101 = icmp ult i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %97
  store i32 8, ptr %18, align 4
  br label %150

103:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %141, %103
  %105 = load i32, ptr %20, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %108 = icmp ult i64 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  store i32 11, ptr %18, align 4
  br label %144

110:                                              ; preds = %104
  %111 = load i32, ptr %19, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %112) #4
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %20, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %116) #4
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp eq i32 %114, %118
  br i1 %119, label %120, label %140

120:                                              ; preds = %110
  %121 = load i32, ptr %19, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %122) #4
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 1
  br i1 %125, label %133, label %126

126:                                              ; preds = %120
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = icmp eq i32 %127, %128
  br i1 %129, label %133, label %130

130:                                              ; preds = %126
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %140

133:                                              ; preds = %130, %126, %120
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = icmp ne i32 %134, 1
  br i1 %135, label %136, label %140

136:                                              ; preds = %133
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = icmp ne i32 %137, 1
  br i1 %138, label %139, label %140

139:                                              ; preds = %136
  store i1 false, ptr %3, align 1
  store i32 1, ptr %18, align 4
  br label %144

140:                                              ; preds = %136, %133, %130, %110
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %20, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %20, align 4, !tbaa !5
  br label %104, !llvm.loop !16

144:                                              ; preds = %139, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %145 = load i32, ptr %18, align 4
  switch i32 %145, label %150 [
    i32 11, label %146
  ]

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %19, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %19, align 4, !tbaa !5
  br label %97, !llvm.loop !17

150:                                              ; preds = %144, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %151 = load i32, ptr %18, align 4
  switch i32 %151, label %153 [
    i32 8, label %152
  ]

152:                                              ; preds = %150
  store i1 true, ptr %3, align 1
  store i32 1, ptr %18, align 4
  br label %153

153:                                              ; preds = %152, %150, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %154 = load i1, ptr %3, align 1
  ret i1 %154

155:                                              ; preds = %85, %55
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %13, align 8
  %158 = load i32, ptr %14, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; 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 noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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 }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z10isRelPrimeii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %0)
  %10 = fptosi double %9 to i32
  %11 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %1)
  %12 = fptosi double %11 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  %.not5578 = icmp slt i32 %10, 1
  br i1 %.not5578, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %24, %2
  %.046.lcssa = phi i1 [ false, %2 ], [ %.147, %24 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  %.not5781 = icmp slt i32 %12, 1
  br i1 %.not5781, label %._crit_edge86, label %.lr.ph85

.lr.ph:                                           ; preds = %2, %24
  %.04680 = phi i1 [ %.147, %24 ], [ false, %2 ]
  %storemerge79 = phi i32 [ %26, %24 ], [ 1, %2 ]
  %13 = srem i32 %0, %storemerge79
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %24

15:                                               ; preds = %.lr.ph
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %16 unwind label %20

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = sdiv i32 %0, %17
  store i32 %18, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %19 unwind label %22

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  br label %24

20:                                               ; preds = %15
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %27

22:                                               ; preds = %16
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %27

24:                                               ; preds = %.lr.ph, %19
  %25 = phi i32 [ %.pre, %19 ], [ %storemerge79, %.lr.ph ]
  %.147 = phi i1 [ true, %19 ], [ %.04680, %.lr.ph ]
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %5, align 4, !tbaa !5
  %.not55.not = icmp slt i32 %25, %10
  br i1 %.not55.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

27:                                               ; preds = %22, %20
  %.pn63 = phi { ptr, i32 } [ %23, %22 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %96

._crit_edge86:                                    ; preds = %40, %._crit_edge
  %.044.lcssa = phi i1 [ false, %._crit_edge ], [ %.145, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %28 = icmp eq i32 %1, 1
  br i1 %.046.lcssa, label %44, label %45

.lr.ph85:                                         ; preds = %._crit_edge, %40
  %.04483 = phi i1 [ %.145, %40 ], [ false, %._crit_edge ]
  %storemerge5682 = phi i32 [ %42, %40 ], [ 1, %._crit_edge ]
  %29 = srem i32 %1, %storemerge5682
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %40

31:                                               ; preds = %.lr.ph85
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %32 unwind label %36

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sdiv i32 %1, %33
  store i32 %34, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %35 unwind label %38

35:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %.pre137 = load i32, ptr %7, align 4, !tbaa !5
  br label %40

36:                                               ; preds = %31
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %43

38:                                               ; preds = %32
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %43

40:                                               ; preds = %.lr.ph85, %35
  %41 = phi i32 [ %.pre137, %35 ], [ %storemerge5682, %.lr.ph85 ]
  %.145 = phi i1 [ true, %35 ], [ %.04483, %.lr.ph85 ]
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %7, align 4, !tbaa !5
  %.not57.not = icmp slt i32 %41, %12
  br i1 %.not57.not, label %.lr.ph85, label %._crit_edge86, !llvm.loop !11

43:                                               ; preds = %38, %36
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %96

44:                                               ; preds = %._crit_edge86
  %or.cond.not = or i1 %28, %.044.lcssa
  br i1 %or.cond.not, label %46, label %.loopexit

45:                                               ; preds = %._crit_edge86
  br i1 %28, label %46, label %.loopexit

46:                                               ; preds = %45, %44
  %47 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not6197 = icmp eq i64 %47, 0
  br i1 %.not6197, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %46
  %.old7.not = icmp eq i32 %0, 1
  %.not59.old = icmp eq i32 %1, 1
  %or.cond66 = or i1 %.old7.not, %.not59.old
  %48 = icmp ne i32 %0, %1
  %49 = icmp ne i32 %0, 0
  %or.cond5.not71 = and i1 %49, %48
  %or.cond8.not68 = or i1 %.old7.not, %or.cond5.not71
  %or.cond = or i1 %.not59.old, %or.cond8.not68
  br i1 %or.cond66, label %.preheader.lr.ph.split.us, label %.preheader.lr.ph.split

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  br i1 %or.cond, label %.preheader.us.us, label %.preheader.us

.preheader.us.us:                                 ; preds = %.preheader.lr.ph.split.us, %.critedge.us.us
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %.critedge.us.us ], [ 0, %.preheader.lr.ph.split.us ]
  %50 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not6088.us.us.not = icmp eq i64 %50, 0
  br i1 %.not6088.us.us.not, label %.critedge.us.us, label %.lr.ph90.us.us

.critedge.us.us:                                  ; preds = %59, %.preheader.us.us
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %51 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not61.us.us.not = icmp ugt i64 %51, %indvars.iv.next135
  br i1 %.not61.us.us.not, label %.preheader.us.us, label %.loopexit, !llvm.loop !12

.lr.ph90.us.us:                                   ; preds = %.preheader.us.us, %59
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %59 ], [ 0, %.preheader.us.us ]
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv134) #4
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv131) #4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %53, %55
  br i1 %56, label %57, label %59

57:                                               ; preds = %.lr.ph90.us.us
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv134) #4
  br label %59

59:                                               ; preds = %57, %.lr.ph90.us.us
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %60 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not60.us.us.us.us = icmp ugt i64 %60, %indvars.iv.next132
  br i1 %.not60.us.us.us.us, label %.lr.ph90.us.us, label %.critedge.us.us, !llvm.loop !13

.preheader.us:                                    ; preds = %.preheader.lr.ph.split.us, %.critedge.us
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %.critedge.us ], [ 0, %.preheader.lr.ph.split.us ]
  %61 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not6088.us.not = icmp eq i64 %61, 0
  br i1 %.not6088.us.not, label %.critedge.us, label %.lr.ph90.us

.critedge.us:                                     ; preds = %71, %.preheader.us
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %62 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not61.us.not = icmp ugt i64 %62, %indvars.iv.next129
  br i1 %.not61.us.not, label %.preheader.us, label %.loopexit, !llvm.loop !12

.lr.ph90.us:                                      ; preds = %.preheader.us, %71
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %71 ], [ 0, %.preheader.us ]
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv128) #4
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv125) #4
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %64, %66
  br i1 %67, label %68, label %71

68:                                               ; preds = %.lr.ph90.us
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv128) #4
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %.not.us.us = icmp eq i32 %70, 1
  br i1 %.not.us.us, label %.loopexit, label %71

71:                                               ; preds = %68, %.lr.ph90.us
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %72 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not60.us.us = icmp ugt i64 %72, %indvars.iv.next126
  br i1 %.not60.us.us, label %.lr.ph90.us, label %.critedge.us, !llvm.loop !13

.preheader.lr.ph.split:                           ; preds = %.preheader.lr.ph
  br i1 %or.cond, label %.preheader.us100, label %.preheader

.preheader.us100:                                 ; preds = %.preheader.lr.ph.split, %.critedge.us103
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.critedge.us103 ], [ 0, %.preheader.lr.ph.split ]
  %73 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not6088.us102.not = icmp eq i64 %73, 0
  br i1 %.not6088.us102.not, label %.critedge.us103, label %.lr.ph90.us105

.critedge.us103:                                  ; preds = %83, %.preheader.us100
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %74 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not61.us104.not = icmp ugt i64 %74, %indvars.iv.next123
  br i1 %.not61.us104.not, label %.preheader.us100, label %.loopexit, !llvm.loop !12

.lr.ph90.us105:                                   ; preds = %.preheader.us100, %83
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %83 ], [ 0, %.preheader.us100 ]
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv122) #4
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv119) #4
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp eq i32 %76, %78
  br i1 %79, label %80, label %83

80:                                               ; preds = %.lr.ph90.us105
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv122) #4
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %.not.us92.us = icmp eq i32 %82, 1
  br i1 %.not.us92.us, label %83, label %.loopexit

83:                                               ; preds = %80, %.lr.ph90.us105
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %84 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not60.us93.us = icmp ugt i64 %84, %indvars.iv.next120
  br i1 %.not60.us93.us, label %.lr.ph90.us105, label %.critedge.us103, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph.split, %.critedge
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.critedge ], [ 0, %.preheader.lr.ph.split ]
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not6088.not = icmp eq i64 %85, 0
  br i1 %.not6088.not, label %.critedge, label %.lr.ph90

.lr.ph90:                                         ; preds = %.preheader, %93
  %indvars.iv = phi i64 [ %indvars.iv.next, %93 ], [ 0, %.preheader ]
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv116) #4
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #4
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp eq i32 %87, %89
  br i1 %90, label %91, label %93

91:                                               ; preds = %.lr.ph90
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv116) #4
  br label %.loopexit

93:                                               ; preds = %.lr.ph90
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %94 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %.not60 = icmp ugt i64 %94, %indvars.iv.next
  br i1 %.not60, label %.lr.ph90, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %93, %.preheader
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %95 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not61.not = icmp ugt i64 %95, %indvars.iv.next117
  br i1 %.not61.not, label %.preheader, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %.critedge, %.critedge.us103, %80, %.critedge.us, %68, %.critedge.us.us, %91, %46, %45, %44
  %.3 = phi i1 [ false, %44 ], [ false, %45 ], [ false, %91 ], [ true, %46 ], [ true, %.critedge.us.us ], [ false, %68 ], [ true, %.critedge.us ], [ false, %80 ], [ true, %.critedge.us103 ], [ true, %.critedge ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret i1 %.3

96:                                               ; preds = %43, %27
  %.pn63.pn = phi { ptr, i32 } [ %.pn63, %27 ], [ %.pn, %43 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn63.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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}


; Effective O3 passes: AggressiveInstCombinePass,ConstraintEliminationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass