; LLVM IR from eyangch/competitive-programming :: Codeforces/1538 (g)

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

@T = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %15

15:                                               ; preds = %76, %27, %0
  %16 = load i64, ptr @T, align 8, !tbaa !8
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr @T, align 8, !tbaa !8
  %18 = icmp ne i64 %16, 0
  br i1 %18, label %19, label %113

19:                                               ; preds = %15
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %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) @y)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %24 = load i64, ptr @a, align 8, !tbaa !8
  %25 = load i64, ptr @b, align 8, !tbaa !8
  %26 = icmp eq i64 %24, %25
  br i1 %26, label %27, label %34

27:                                               ; preds = %19
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @x, ptr noundef nonnull align 8 dereferenceable(8) @y)
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %30 = load i64, ptr @a, align 8, !tbaa !8
  %31 = sdiv i64 %29, %30
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %31)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %32, i8 noundef signext 10)
  br label %15, !llvm.loop !11

34:                                               ; preds = %19
  %35 = load i64, ptr @x, align 8, !tbaa !8
  %36 = load i64, ptr @y, align 8, !tbaa !8
  %37 = icmp sgt i64 %35, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @x, ptr noundef nonnull align 8 dereferenceable(8) @y) #7
  br label %39

39:                                               ; preds = %38, %34
  %40 = load i64, ptr @a, align 8, !tbaa !8
  %41 = load i64, ptr @b, align 8, !tbaa !8
  %42 = icmp sgt i64 %40, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @a, ptr noundef nonnull align 8 dereferenceable(8) @b) #7
  br label %44

44:                                               ; preds = %43, %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  %45 = load i64, ptr @y, align 8, !tbaa !8
  %46 = load i64, ptr @x, align 8, !tbaa !8
  %47 = sub nsw i64 %45, %46
  %48 = load i64, ptr @b, align 8, !tbaa !8
  %49 = load i64, ptr @a, align 8, !tbaa !8
  %50 = sub nsw i64 %48, %49
  %51 = icmp sgt i64 %47, %50
  br i1 %51, label %52, label %76

52:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %53 = load i64, ptr @y, align 8, !tbaa !8
  %54 = load i64, ptr @x, align 8, !tbaa !8
  %55 = sub nsw i64 %53, %54
  %56 = load i64, ptr @b, align 8, !tbaa !8
  %57 = load i64, ptr @a, align 8, !tbaa !8
  %58 = sub nsw i64 %56, %57
  %59 = sdiv i64 %55, %58
  store i64 %59, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %60 = load i64, ptr @x, align 8, !tbaa !8
  %61 = load i64, ptr @a, align 8, !tbaa !8
  %62 = sdiv i64 %60, %61
  store i64 %62, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %64 = load i64, ptr %63, align 8, !tbaa !8
  store i64 %64, ptr %5, align 8, !tbaa !8
  %65 = load i64, ptr %5, align 8, !tbaa !8
  store i64 %65, ptr %2, align 8, !tbaa !8
  %66 = load i64, ptr @a, align 8, !tbaa !8
  %67 = load i64, ptr %5, align 8, !tbaa !8
  %68 = mul nsw i64 %66, %67
  %69 = load i64, ptr @x, align 8, !tbaa !8
  %70 = sub nsw i64 %69, %68
  store i64 %70, ptr @x, align 8, !tbaa !8
  %71 = load i64, ptr @b, align 8, !tbaa !8
  %72 = load i64, ptr %5, align 8, !tbaa !8
  %73 = mul nsw i64 %71, %72
  %74 = load i64, ptr @y, align 8, !tbaa !8
  %75 = sub nsw i64 %74, %73
  store i64 %75, ptr @y, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %76

76:                                               ; preds = %52, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %77 = load i64, ptr @x, align 8, !tbaa !8
  %78 = load i64, ptr @a, align 8, !tbaa !8
  %79 = load i64, ptr @b, align 8, !tbaa !8
  %80 = add nsw i64 %78, %79
  %81 = sdiv i64 %77, %80
  %82 = mul nsw i64 2, %81
  %83 = load i64, ptr @x, align 8, !tbaa !8
  %84 = load i64, ptr @a, align 8, !tbaa !8
  %85 = load i64, ptr @b, align 8, !tbaa !8
  %86 = add nsw i64 %84, %85
  %87 = srem i64 %83, %86
  %88 = load i64, ptr @a, align 8, !tbaa !8
  %89 = icmp sge i64 %87, %88
  %90 = zext i1 %89 to i64
  %91 = add nsw i64 %82, %90
  store i64 %91, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %92 = load i64, ptr @y, align 8, !tbaa !8
  %93 = load i64, ptr @a, align 8, !tbaa !8
  %94 = load i64, ptr @b, align 8, !tbaa !8
  %95 = add nsw i64 %93, %94
  %96 = sdiv i64 %92, %95
  %97 = mul nsw i64 2, %96
  %98 = load i64, ptr @y, align 8, !tbaa !8
  %99 = load i64, ptr @a, align 8, !tbaa !8
  %100 = load i64, ptr @b, align 8, !tbaa !8
  %101 = add nsw i64 %99, %100
  %102 = srem i64 %98, %101
  %103 = load i64, ptr @b, align 8, !tbaa !8
  %104 = icmp sge i64 %102, %103
  %105 = zext i1 %104 to i64
  %106 = add nsw i64 %97, %105
  store i64 %106, ptr %7, align 8, !tbaa !8
  %107 = load i64, ptr %2, align 8, !tbaa !8
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = add nsw i64 %107, %109
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %110)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %111, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %15, !llvm.loop !11

113:                                              ; preds = %15
  %114 = load i32, ptr %1, align 4
  ret i32 %114
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #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)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

attributes #0 = { 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 #1 = { 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 #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 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" }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"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" }

@T = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = 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) @T)
  %12 = load i64, ptr @T, align 8, !tbaa !8
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr @T, align 8, !tbaa !8
  %.not5 = icmp eq i64 %12, 0
  br i1 %.not5, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.backedge
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %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) @y)
  %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) @a)
  %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) @b)
  %18 = load i64, ptr @a, align 8, !tbaa !8
  %19 = load i64, ptr @b, align 8, !tbaa !8
  %20 = icmp eq i64 %18, %19
  br i1 %20, label %21, label %30

21:                                               ; preds = %.lr.ph
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @x, ptr noundef nonnull align 8 dereferenceable(8) @y)
  %23 = load i64, ptr %22, align 8, !tbaa !8
  %24 = load i64, ptr @a, align 8, !tbaa !8
  %25 = sdiv i64 %23, %24
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %25)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext 10)
  br label %.backedge

.backedge:                                        ; preds = %21, %61
  %28 = load i64, ptr @T, align 8, !tbaa !8
  %29 = add nsw i64 %28, -1
  store i64 %29, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

30:                                               ; preds = %.lr.ph
  %31 = load i64, ptr @x, align 8, !tbaa !8
  %32 = load i64, ptr @y, align 8, !tbaa !8
  %33 = icmp sgt i64 %31, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @x, ptr noundef nonnull align 8 dereferenceable(8) @y) #7
  %.pre = load i64, ptr @a, align 8, !tbaa !8
  %.pre6 = load i64, ptr @b, align 8, !tbaa !8
  br label %35

35:                                               ; preds = %34, %30
  %36 = phi i64 [ %.pre6, %34 ], [ %19, %30 ]
  %37 = phi i64 [ %.pre, %34 ], [ %18, %30 ]
  %38 = icmp sgt i64 %37, %36
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @a, ptr noundef nonnull align 8 dereferenceable(8) @b) #7
  %.pre7 = load i64, ptr @b, align 8, !tbaa !8
  %.pre8 = load i64, ptr @a, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %39, %35
  %41 = phi i64 [ %.pre8, %39 ], [ %37, %35 ]
  %42 = phi i64 [ %.pre7, %39 ], [ %36, %35 ]
  %43 = load i64, ptr @y, align 8, !tbaa !8
  %44 = load i64, ptr @x, align 8, !tbaa !8
  %45 = sub nsw i64 %43, %44
  %46 = sub nsw i64 %42, %41
  %47 = icmp sgt i64 %45, %46
  br i1 %47, label %48, label %61

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %49 = sdiv i64 %45, %46
  store i64 %49, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %50 = sdiv i64 %44, %41
  store i64 %50, ptr %2, align 8, !tbaa !8
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = load i64, ptr @a, align 8, !tbaa !8
  %54 = mul nsw i64 %53, %52
  %55 = load i64, ptr @x, align 8, !tbaa !8
  %56 = sub nsw i64 %55, %54
  store i64 %56, ptr @x, align 8, !tbaa !8
  %57 = load i64, ptr @b, align 8, !tbaa !8
  %58 = mul nsw i64 %57, %52
  %59 = load i64, ptr @y, align 8, !tbaa !8
  %60 = sub nsw i64 %59, %58
  store i64 %60, ptr @y, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  br label %61

61:                                               ; preds = %48, %40
  %62 = phi i64 [ %60, %48 ], [ %43, %40 ]
  %63 = phi i64 [ %57, %48 ], [ %42, %40 ]
  %64 = phi i64 [ %53, %48 ], [ %41, %40 ]
  %65 = phi i64 [ %56, %48 ], [ %44, %40 ]
  %.0 = phi i64 [ %52, %48 ], [ 0, %40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %66 = add nsw i64 %63, %64
  %67 = sdiv i64 %65, %66
  %68 = shl nsw i64 %67, 1
  %69 = srem i64 %65, %66
  %70 = icmp sge i64 %69, %64
  %71 = zext i1 %70 to i64
  %72 = or disjoint i64 %68, %71
  store i64 %72, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %73 = sdiv i64 %62, %66
  %74 = shl nsw i64 %73, 1
  %75 = srem i64 %62, %66
  %76 = icmp sge i64 %75, %63
  %77 = zext i1 %76 to i64
  %78 = or disjoint i64 %74, %77
  store i64 %78, ptr %4, align 8, !tbaa !8
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = add nsw i64 %80, %.0
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %81)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %82, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %0
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #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 #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

attributes #0 = { 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 #1 = { 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 #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 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" }
attributes #5 = { 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 #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass