; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/153 Division 1/Problem C (C)

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

@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@k = external dso_local global i64, align 8
@l = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3lcmxx(i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z2goii(i32 noundef, i32 noundef) #0

; 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %8 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %22 = load i64, ptr @b, align 8, !tbaa !8
  %23 = load i64, ptr @a, align 8, !tbaa !8
  %24 = icmp eq i64 %22, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %0
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %127

28:                                               ; preds = %0
  %29 = load i64, ptr @k, align 8, !tbaa !8
  %30 = icmp eq i64 %29, 1
  br i1 %30, label %31, label %37

31:                                               ; preds = %28
  %32 = load i64, ptr @b, align 8, !tbaa !8
  %33 = load i64, ptr @a, align 8, !tbaa !8
  %34 = sub nsw i64 %32, %33
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %34)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %127

37:                                               ; preds = %28
  store i64 1, ptr @l, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 2, ptr %2, align 4, !tbaa !11
  br label %38

38:                                               ; preds = %49, %37
  %39 = load i32, ptr %2, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = load i64, ptr @k, align 8, !tbaa !8
  %42 = icmp sle i64 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %52

44:                                               ; preds = %38
  %45 = load i64, ptr @l, align 8, !tbaa !8
  %46 = load i32, ptr %2, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef i64 @_Z3lcmxx(i64 noundef %45, i64 noundef %47)
  store i64 %48, ptr @l, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %44
  %50 = load i32, ptr %2, align 4, !tbaa !11
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !11
  br label %38, !llvm.loop !13

52:                                               ; preds = %43
  %53 = load i64, ptr @a, align 8, !tbaa !8
  %54 = load i64, ptr @l, align 8, !tbaa !8
  %55 = sdiv i64 %53, %54
  %56 = load i64, ptr @b, align 8, !tbaa !8
  %57 = load i64, ptr @l, align 8, !tbaa !8
  %58 = sdiv i64 %56, %57
  %59 = icmp eq i64 %55, %58
  br i1 %59, label %60, label %72

60:                                               ; preds = %52
  %61 = load i64, ptr @b, align 8, !tbaa !8
  %62 = load i64, ptr @l, align 8, !tbaa !8
  %63 = srem i64 %61, %62
  %64 = trunc i64 %63 to i32
  %65 = load i64, ptr @a, align 8, !tbaa !8
  %66 = load i64, ptr @l, align 8, !tbaa !8
  %67 = srem i64 %65, %66
  %68 = trunc i64 %67 to i32
  %69 = call noundef i64 @_Z2goii(i32 noundef %64, i32 noundef %68)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %69)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %127

72:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %73 = load i64, ptr @l, align 8, !tbaa !8
  %74 = sub nsw i64 %73, 1
  %75 = trunc i64 %74 to i32
  %76 = call noundef i64 @_Z2goii(i32 noundef %75, i32 noundef 0)
  store i64 %76, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %77 = load i64, ptr @b, align 8, !tbaa !8
  %78 = load i64, ptr @l, align 8, !tbaa !8
  %79 = srem i64 %77, %78
  %80 = icmp eq i64 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %72
  br label %88

82:                                               ; preds = %72
  %83 = load i64, ptr @b, align 8, !tbaa !8
  %84 = load i64, ptr @l, align 8, !tbaa !8
  %85 = srem i64 %83, %84
  %86 = trunc i64 %85 to i32
  %87 = call noundef i64 @_Z2goii(i32 noundef %86, i32 noundef 0)
  br label %88

88:                                               ; preds = %82, %81
  %89 = phi i64 [ 0, %81 ], [ %87, %82 ]
  store i64 %89, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %90 = load i64, ptr @a, align 8, !tbaa !8
  %91 = load i64, ptr @l, align 8, !tbaa !8
  %92 = srem i64 %90, %91
  %93 = icmp eq i64 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %88
  br label %105

95:                                               ; preds = %88
  %96 = load i64, ptr @l, align 8, !tbaa !8
  %97 = sub nsw i64 %96, 1
  %98 = trunc i64 %97 to i32
  %99 = load i64, ptr @a, align 8, !tbaa !8
  %100 = load i64, ptr @l, align 8, !tbaa !8
  %101 = srem i64 %99, %100
  %102 = trunc i64 %101 to i32
  %103 = call noundef i64 @_Z2goii(i32 noundef %98, i32 noundef %102)
  %104 = add nsw i64 %103, 1
  br label %105

105:                                              ; preds = %95, %94
  %106 = phi i64 [ 0, %94 ], [ %104, %95 ]
  store i64 %106, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %107 = load i64, ptr @b, align 8, !tbaa !8
  %108 = load i64, ptr @l, align 8, !tbaa !8
  %109 = sdiv i64 %107, %108
  %110 = load i64, ptr @a, align 8, !tbaa !8
  %111 = sub nsw i64 %110, 1
  %112 = load i64, ptr @l, align 8, !tbaa !8
  %113 = sdiv i64 %111, %112
  %114 = sub nsw i64 %109, %113
  store i64 %114, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %115 = load i64, ptr %6, align 8, !tbaa !8
  %116 = sub nsw i64 %115, 1
  %117 = load i64, ptr %3, align 8, !tbaa !8
  %118 = add nsw i64 %117, 1
  %119 = mul nsw i64 %116, %118
  %120 = load i64, ptr %4, align 8, !tbaa !8
  %121 = add nsw i64 %119, %120
  %122 = load i64, ptr %5, align 8, !tbaa !8
  %123 = add nsw i64 %121, %122
  store i64 %123, ptr %7, align 8, !tbaa !8
  %124 = load i64, ptr %7, align 8, !tbaa !8
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %124)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %127

127:                                              ; preds = %105, %60, %31, %25
  %128 = load i32, ptr %1, align 4
  ret i32 %128
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #4 align 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)) #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@k = external dso_local global i64, align 8
@l = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3lcmxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z2goii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %15 = load i64, ptr @b, align 8, !tbaa !8
  %16 = load i64, ptr @a, align 8, !tbaa !8
  %17 = icmp eq i64 %15, %16
  br i1 %17, label %18, label %20

18:                                               ; preds = %0
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %81

20:                                               ; preds = %0
  %21 = load i64, ptr @k, align 8, !tbaa !8
  %22 = icmp eq i64 %21, 1
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = sub nsw i64 %15, %16
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %24)
  br label %81

26:                                               ; preds = %20
  store i64 1, ptr @l, align 8, !tbaa !8
  %.not14 = icmp slt i64 %21, 2
  br i1 %.not14, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr @a, align 8, !tbaa !8
  %.pre17 = load i64, ptr @b, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %26
  %27 = phi i64 [ %.pre17, %._crit_edge.loopexit ], [ %15, %26 ]
  %28 = phi i64 [ %36, %._crit_edge.loopexit ], [ 1, %26 ]
  %29 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %16, %26 ]
  %30 = sdiv i64 %29, %28
  %31 = srem i64 %29, %28
  %32 = sdiv i64 %27, %28
  %33 = srem i64 %27, %28
  %34 = icmp eq i64 %30, %32
  br i1 %34, label %38, label %43

.lr.ph:                                           ; preds = %26, %.lr.ph
  %35 = phi i64 [ %36, %.lr.ph ], [ 1, %26 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 2, %26 ]
  %36 = tail call noundef i64 @_Z3lcmxx(i64 noundef %35, i64 noundef %indvars.iv)
  store i64 %36, ptr @l, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i64, ptr @k, align 8, !tbaa !8
  %.not.not = icmp sgt i64 %37, %indvars.iv
  br i1 %.not.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

38:                                               ; preds = %._crit_edge
  %39 = trunc i64 %33 to i32
  %40 = trunc i64 %31 to i32
  %41 = tail call noundef i64 @_Z2goii(i32 noundef %39, i32 noundef %40)
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %41)
  br label %81

43:                                               ; preds = %._crit_edge
  %44 = trunc i64 %28 to i32
  %45 = add i32 %44, -1
  %46 = tail call noundef i64 @_Z2goii(i32 noundef %45, i32 noundef 0)
  %47 = load i64, ptr @b, align 8, !tbaa !8
  %48 = load i64, ptr @l, align 8, !tbaa !8
  %49 = srem i64 %47, %48
  %50 = icmp eq i64 %49, 0
  br i1 %50, label %54, label %51

51:                                               ; preds = %43
  %52 = trunc i64 %49 to i32
  %53 = tail call noundef i64 @_Z2goii(i32 noundef %52, i32 noundef 0)
  %.pre18 = load i64, ptr @l, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %43, %51
  %55 = phi i64 [ %.pre18, %51 ], [ %48, %43 ]
  %56 = phi i64 [ %53, %51 ], [ 0, %43 ]
  %57 = load i64, ptr @a, align 8, !tbaa !8
  %58 = srem i64 %57, %55
  %59 = icmp eq i64 %58, 0
  br i1 %59, label %66, label %60

60:                                               ; preds = %54
  %61 = trunc i64 %55 to i32
  %62 = add i32 %61, -1
  %63 = trunc i64 %58 to i32
  %64 = tail call noundef i64 @_Z2goii(i32 noundef %62, i32 noundef %63)
  %65 = add nsw i64 %64, 1
  %.pre19 = load i64, ptr @l, align 8, !tbaa !8
  %.pre20 = load i64, ptr @a, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %54, %60
  %67 = phi i64 [ %.pre20, %60 ], [ %57, %54 ]
  %68 = phi i64 [ %.pre19, %60 ], [ %55, %54 ]
  %69 = phi i64 [ %65, %60 ], [ 0, %54 ]
  %70 = load i64, ptr @b, align 8, !tbaa !8
  %71 = sdiv i64 %70, %68
  %72 = add nsw i64 %67, -1
  %73 = sdiv i64 %72, %68
  %74 = xor i64 %73, -1
  %75 = add i64 %71, %74
  %76 = add nsw i64 %46, 1
  %77 = mul nsw i64 %75, %76
  %78 = add i64 %69, %56
  %79 = add i64 %78, %77
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %79)
  br label %81

81:                                               ; preds = %66, %38, %23, %18
  %.sink = phi ptr [ %80, %66 ], [ %42, %38 ], [ %25, %23 ], [ %19, %18 ]
  %82 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #3 align 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 #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 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 norecurse 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 = { "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 = { 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" }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass