; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/SNACKDOWN/16/Elimination/Problem A/A.ll (Z5solvev)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkxxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = load i64, ptr %4, align 8, !tbaa !5
  %20 = add nsw i64 %18, %19
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = mul nsw i64 %21, %22
  %24 = load i64, ptr %5, align 8, !tbaa !5
  %25 = sub nsw i64 %23, %24
  %26 = icmp ne i64 %20, %25
  br i1 %26, label %27, label %29

27:                                               ; preds = %0
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 1, ptr %6, align 4
  br label %163

29:                                               ; preds = %0
  %30 = load i64, ptr %3, align 8, !tbaa !5
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = srem i64 %30, %31
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %51

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %36 = load i64, ptr %1, align 8, !tbaa !5
  %37 = sdiv i64 %35, %36
  store i64 %37, ptr %7, align 8, !tbaa !5
  %38 = load i64, ptr %1, align 8, !tbaa !5
  %39 = load i64, ptr %2, align 8, !tbaa !5
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = sub nsw i64 %39, %40
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %43 = load i64, ptr %5, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %38, i64 noundef %41, i64 noundef %42, i64 noundef %43)
  br i1 %44, label %45, label %47

45:                                               ; preds = %34
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %48

47:                                               ; preds = %34
  store i32 0, ptr %6, align 4
  br label %48

48:                                               ; preds = %47, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %49 = load i32, ptr %6, align 4
  switch i32 %49, label %163 [
    i32 0, label %50
  ]

50:                                               ; preds = %48
  br label %51

51:                                               ; preds = %50, %29
  %52 = load i64, ptr %5, align 8, !tbaa !5
  %53 = load i64, ptr %1, align 8, !tbaa !5
  %54 = srem i64 %52, %53
  %55 = icmp eq i64 %54, 0
  br i1 %55, label %56, label %73

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %57 = load i64, ptr %5, align 8, !tbaa !5
  %58 = load i64, ptr %1, align 8, !tbaa !5
  %59 = sdiv i64 %57, %58
  store i64 %59, ptr %8, align 8, !tbaa !5
  %60 = load i64, ptr %1, align 8, !tbaa !5
  %61 = load i64, ptr %2, align 8, !tbaa !5
  %62 = load i64, ptr %8, align 8, !tbaa !5
  %63 = sub nsw i64 %61, %62
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = load i64, ptr %4, align 8, !tbaa !5
  %66 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %60, i64 noundef %63, i64 noundef %64, i64 noundef %65)
  br i1 %66, label %67, label %69

67:                                               ; preds = %56
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %70

69:                                               ; preds = %56
  store i32 0, ptr %6, align 4
  br label %70

70:                                               ; preds = %69, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %71 = load i32, ptr %6, align 4
  switch i32 %71, label %163 [
    i32 0, label %72
  ]

72:                                               ; preds = %70
  br label %73

73:                                               ; preds = %72, %51
  %74 = load i64, ptr %4, align 8, !tbaa !5
  %75 = load i64, ptr %1, align 8, !tbaa !5
  %76 = srem i64 %74, %75
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %78, label %95

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %79 = load i64, ptr %4, align 8, !tbaa !5
  %80 = load i64, ptr %1, align 8, !tbaa !5
  %81 = sdiv i64 %79, %80
  store i64 %81, ptr %9, align 8, !tbaa !5
  %82 = load i64, ptr %1, align 8, !tbaa !5
  %83 = load i64, ptr %2, align 8, !tbaa !5
  %84 = load i64, ptr %9, align 8, !tbaa !5
  %85 = sub nsw i64 %83, %84
  %86 = load i64, ptr %3, align 8, !tbaa !5
  %87 = load i64, ptr %5, align 8, !tbaa !5
  %88 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %82, i64 noundef %85, i64 noundef %86, i64 noundef %87)
  br i1 %88, label %89, label %91

89:                                               ; preds = %78
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %92

91:                                               ; preds = %78
  store i32 0, ptr %6, align 4
  br label %92

92:                                               ; preds = %91, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %93 = load i32, ptr %6, align 4
  switch i32 %93, label %163 [
    i32 0, label %94
  ]

94:                                               ; preds = %92
  br label %95

95:                                               ; preds = %94, %73
  %96 = load i64, ptr %3, align 8, !tbaa !5
  %97 = load i64, ptr %2, align 8, !tbaa !5
  %98 = srem i64 %96, %97
  %99 = icmp eq i64 %98, 0
  br i1 %99, label %100, label %117

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %101 = load i64, ptr %3, align 8, !tbaa !5
  %102 = load i64, ptr %2, align 8, !tbaa !5
  %103 = sdiv i64 %101, %102
  store i64 %103, ptr %10, align 8, !tbaa !5
  %104 = load i64, ptr %1, align 8, !tbaa !5
  %105 = load i64, ptr %10, align 8, !tbaa !5
  %106 = sub nsw i64 %104, %105
  %107 = load i64, ptr %2, align 8, !tbaa !5
  %108 = load i64, ptr %4, align 8, !tbaa !5
  %109 = load i64, ptr %5, align 8, !tbaa !5
  %110 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %106, i64 noundef %107, i64 noundef %108, i64 noundef %109)
  br i1 %110, label %111, label %113

111:                                              ; preds = %100
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %114

113:                                              ; preds = %100
  store i32 0, ptr %6, align 4
  br label %114

114:                                              ; preds = %113, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %115 = load i32, ptr %6, align 4
  switch i32 %115, label %163 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116, %95
  %118 = load i64, ptr %5, align 8, !tbaa !5
  %119 = load i64, ptr %2, align 8, !tbaa !5
  %120 = srem i64 %118, %119
  %121 = icmp eq i64 %120, 0
  br i1 %121, label %122, label %139

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %123 = load i64, ptr %5, align 8, !tbaa !5
  %124 = load i64, ptr %2, align 8, !tbaa !5
  %125 = sdiv i64 %123, %124
  store i64 %125, ptr %11, align 8, !tbaa !5
  %126 = load i64, ptr %1, align 8, !tbaa !5
  %127 = load i64, ptr %11, align 8, !tbaa !5
  %128 = sub nsw i64 %126, %127
  %129 = load i64, ptr %2, align 8, !tbaa !5
  %130 = load i64, ptr %3, align 8, !tbaa !5
  %131 = load i64, ptr %4, align 8, !tbaa !5
  %132 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %128, i64 noundef %129, i64 noundef %130, i64 noundef %131)
  br i1 %132, label %133, label %135

133:                                              ; preds = %122
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %136

135:                                              ; preds = %122
  store i32 0, ptr %6, align 4
  br label %136

136:                                              ; preds = %135, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %137 = load i32, ptr %6, align 4
  switch i32 %137, label %163 [
    i32 0, label %138
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %117
  %140 = load i64, ptr %4, align 8, !tbaa !5
  %141 = load i64, ptr %2, align 8, !tbaa !5
  %142 = srem i64 %140, %141
  %143 = icmp eq i64 %142, 0
  br i1 %143, label %144, label %161

144:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %145 = load i64, ptr %4, align 8, !tbaa !5
  %146 = load i64, ptr %2, align 8, !tbaa !5
  %147 = sdiv i64 %145, %146
  store i64 %147, ptr %12, align 8, !tbaa !5
  %148 = load i64, ptr %1, align 8, !tbaa !5
  %149 = load i64, ptr %12, align 8, !tbaa !5
  %150 = sub nsw i64 %148, %149
  %151 = load i64, ptr %2, align 8, !tbaa !5
  %152 = load i64, ptr %3, align 8, !tbaa !5
  %153 = load i64, ptr %5, align 8, !tbaa !5
  %154 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %150, i64 noundef %151, i64 noundef %152, i64 noundef %153)
  br i1 %154, label %155, label %157

155:                                              ; preds = %144
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store i32 1, ptr %6, align 4
  br label %158

157:                                              ; preds = %144
  store i32 0, ptr %6, align 4
  br label %158

158:                                              ; preds = %157, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %159 = load i32, ptr %6, align 4
  switch i32 %159, label %163 [
    i32 0, label %160
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %139
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 0, ptr %6, align 4
  br label %163

163:                                              ; preds = %161, %158, %136, %114, %92, %70, %48, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  %164 = load i32, ptr %6, align 4
  switch i32 %164, label %166 [
    i32 0, label %165
    i32 1, label %165
  ]

165:                                              ; preds = %163, %163
  ret void

166:                                              ; preds = %163
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkxxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %11 = load i64, ptr %3, align 8, !tbaa !5
  %12 = load i64, ptr %4, align 8, !tbaa !5
  %13 = add nsw i64 %12, %11
  %14 = load i64, ptr %1, align 8, !tbaa !5
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = mul nsw i64 %15, %14
  %17 = load i64, ptr %5, align 8, !tbaa !5
  %18 = sub nsw i64 %16, %17
  %.not = icmp eq i64 %13, %18
  br i1 %.not, label %19, label %72

19:                                               ; preds = %0
  %20 = srem i64 %11, %14
  %21 = sdiv i64 %11, %14
  %22 = icmp eq i64 %20, 0
  br i1 %22, label %23, label %.critedge

23:                                               ; preds = %19
  %24 = sub nsw i64 %15, %21
  %25 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %14, i64 noundef %24, i64 noundef %12, i64 noundef %17)
  br i1 %25, label %72, label %..critedge_crit_edge

..critedge_crit_edge:                             ; preds = %23
  %.pre = load i64, ptr %5, align 8, !tbaa !5
  %.pre27 = load i64, ptr %1, align 8, !tbaa !5
  %.pre29.pre = load i64, ptr %4, align 8, !tbaa !5
  %.pre32.pre42.pre = load i64, ptr %3, align 8, !tbaa !5
  %.pre34.pre44.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %.critedge

.critedge:                                        ; preds = %..critedge_crit_edge, %19
  %.pre34.pre44 = phi i64 [ %.pre34.pre44.pre, %..critedge_crit_edge ], [ %15, %19 ]
  %.pre32.pre42 = phi i64 [ %.pre32.pre42.pre, %..critedge_crit_edge ], [ %11, %19 ]
  %.pre29 = phi i64 [ %.pre29.pre, %..critedge_crit_edge ], [ %12, %19 ]
  %26 = phi i64 [ %.pre27, %..critedge_crit_edge ], [ %14, %19 ]
  %27 = phi i64 [ %.pre, %..critedge_crit_edge ], [ %17, %19 ]
  %28 = srem i64 %27, %26
  %29 = sdiv i64 %27, %26
  %30 = icmp eq i64 %28, 0
  br i1 %30, label %31, label %.critedge18

31:                                               ; preds = %.critedge
  %32 = sub nsw i64 %.pre34.pre44, %29
  %33 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %26, i64 noundef %32, i64 noundef %.pre32.pre42, i64 noundef %.pre29)
  br i1 %33, label %72, label %..critedge18_crit_edge

..critedge18_crit_edge:                           ; preds = %31
  %.pre28 = load i64, ptr %4, align 8, !tbaa !5
  %.pre30 = load i64, ptr %1, align 8, !tbaa !5
  %.pre32.pre = load i64, ptr %3, align 8, !tbaa !5
  %.pre34.pre = load i64, ptr %2, align 8, !tbaa !5
  %.pre36.pre46.pre = load i64, ptr %5, align 8, !tbaa !5
  br label %.critedge18

.critedge18:                                      ; preds = %..critedge18_crit_edge, %.critedge
  %.pre36.pre46 = phi i64 [ %.pre36.pre46.pre, %..critedge18_crit_edge ], [ %27, %.critedge ]
  %.pre34 = phi i64 [ %.pre34.pre, %..critedge18_crit_edge ], [ %.pre34.pre44, %.critedge ]
  %.pre32 = phi i64 [ %.pre32.pre, %..critedge18_crit_edge ], [ %.pre32.pre42, %.critedge ]
  %34 = phi i64 [ %.pre30, %..critedge18_crit_edge ], [ %26, %.critedge ]
  %35 = phi i64 [ %.pre28, %..critedge18_crit_edge ], [ %.pre29, %.critedge ]
  %36 = srem i64 %35, %34
  %37 = sdiv i64 %35, %34
  %38 = icmp eq i64 %36, 0
  br i1 %38, label %39, label %.critedge20

39:                                               ; preds = %.critedge18
  %40 = sub nsw i64 %.pre34, %37
  %41 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %34, i64 noundef %40, i64 noundef %.pre32, i64 noundef %.pre36.pre46)
  br i1 %41, label %72, label %..critedge20_crit_edge

..critedge20_crit_edge:                           ; preds = %39
  %.pre31 = load i64, ptr %3, align 8, !tbaa !5
  %.pre33 = load i64, ptr %2, align 8, !tbaa !5
  %.pre36.pre = load i64, ptr %5, align 8, !tbaa !5
  %.pre39.pre48.pre = load i64, ptr %4, align 8, !tbaa !5
  br label %.critedge20

.critedge20:                                      ; preds = %..critedge20_crit_edge, %.critedge18
  %.pre39.pre48 = phi i64 [ %.pre39.pre48.pre, %..critedge20_crit_edge ], [ %35, %.critedge18 ]
  %.pre36 = phi i64 [ %.pre36.pre, %..critedge20_crit_edge ], [ %.pre36.pre46, %.critedge18 ]
  %42 = phi i64 [ %.pre33, %..critedge20_crit_edge ], [ %.pre34, %.critedge18 ]
  %43 = phi i64 [ %.pre31, %..critedge20_crit_edge ], [ %.pre32, %.critedge18 ]
  %44 = srem i64 %43, %42
  %45 = sdiv i64 %43, %42
  %46 = icmp eq i64 %44, 0
  br i1 %46, label %47, label %.critedge22

47:                                               ; preds = %.critedge20
  %48 = load i64, ptr %1, align 8, !tbaa !5
  %49 = sub nsw i64 %48, %45
  %50 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %49, i64 noundef %42, i64 noundef %.pre39.pre48, i64 noundef %.pre36)
  br i1 %50, label %72, label %..critedge22_crit_edge

..critedge22_crit_edge:                           ; preds = %47
  %.pre35 = load i64, ptr %5, align 8, !tbaa !5
  %.pre37 = load i64, ptr %2, align 8, !tbaa !5
  %.pre39.pre = load i64, ptr %4, align 8, !tbaa !5
  br label %.critedge22

.critedge22:                                      ; preds = %..critedge22_crit_edge, %.critedge20
  %.pre39 = phi i64 [ %.pre39.pre, %..critedge22_crit_edge ], [ %.pre39.pre48, %.critedge20 ]
  %51 = phi i64 [ %.pre37, %..critedge22_crit_edge ], [ %42, %.critedge20 ]
  %52 = phi i64 [ %.pre35, %..critedge22_crit_edge ], [ %.pre36, %.critedge20 ]
  %53 = srem i64 %52, %51
  %54 = sdiv i64 %52, %51
  %55 = icmp eq i64 %53, 0
  br i1 %55, label %56, label %.critedge24

56:                                               ; preds = %.critedge22
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = sub nsw i64 %57, %54
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %58, i64 noundef %51, i64 noundef %59, i64 noundef %.pre39)
  br i1 %60, label %72, label %..critedge24_crit_edge

..critedge24_crit_edge:                           ; preds = %56
  %.pre38 = load i64, ptr %4, align 8, !tbaa !5
  %.pre40 = load i64, ptr %2, align 8, !tbaa !5
  br label %.critedge24

.critedge24:                                      ; preds = %..critedge24_crit_edge, %.critedge22
  %61 = phi i64 [ %.pre40, %..critedge24_crit_edge ], [ %51, %.critedge22 ]
  %62 = phi i64 [ %.pre38, %..critedge24_crit_edge ], [ %.pre39, %.critedge22 ]
  %63 = srem i64 %62, %61
  %64 = sdiv i64 %62, %61
  %65 = icmp eq i64 %63, 0
  br i1 %65, label %66, label %.critedge26

66:                                               ; preds = %.critedge24
  %67 = load i64, ptr %1, align 8, !tbaa !5
  %68 = sub nsw i64 %67, %64
  %69 = load i64, ptr %3, align 8, !tbaa !5
  %70 = load i64, ptr %5, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_Z5checkxxxx(i64 noundef %68, i64 noundef %61, i64 noundef %69, i64 noundef %70)
  br i1 %71, label %72, label %.critedge26

.critedge26:                                      ; preds = %66, %.critedge24
  br label %72

72:                                               ; preds = %66, %56, %47, %39, %31, %23, %0, %.critedge26
  %.str.1.sink = phi ptr [ @.str, %.critedge26 ], [ @.str, %0 ], [ @.str.1, %23 ], [ @.str.1, %31 ], [ @.str.1, %39 ], [ @.str.1, %47 ], [ @.str.1, %56 ], [ @.str.1, %66 ]
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void
}

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass