; LLVM IR from eyangch/competitive-programming :: Codeforces/1461 (e)

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

@k = external dso_local global i64, align 8
@l = external dso_local global i64, align 8
@r = external dso_local global i64, align 8
@t = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@dp = external dso_local global [1000000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; 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 i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %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) @l)
  %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) @r)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @t)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %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) @y)
  %21 = load i64, ptr @x, align 8, !tbaa !8
  %22 = load i64, ptr @y, align 8, !tbaa !8
  %23 = icmp eq i64 %21, %22
  br i1 %23, label %24, label %44

24:                                               ; preds = %0
  %25 = load i64, ptr @k, align 8, !tbaa !8
  %26 = load i64, ptr @y, align 8, !tbaa !8
  %27 = add nsw i64 %25, %26
  %28 = load i64, ptr @r, align 8, !tbaa !8
  %29 = icmp sle i64 %27, %28
  br i1 %29, label %30, label %34

30:                                               ; preds = %24
  %31 = load i64, ptr @y, align 8, !tbaa !8
  %32 = load i64, ptr @k, align 8, !tbaa !8
  %33 = add nsw i64 %32, %31
  store i64 %33, ptr @k, align 8, !tbaa !8
  br label %34

34:                                               ; preds = %30, %24
  %35 = load i64, ptr @k, align 8, !tbaa !8
  %36 = load i64, ptr @x, align 8, !tbaa !8
  %37 = sub nsw i64 %35, %36
  %38 = load i64, ptr @l, align 8, !tbaa !8
  %39 = icmp sge i64 %37, %38
  %40 = zext i1 %39 to i64
  %41 = select i1 %39, ptr @.str, ptr @.str.1
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef @.str.2)
  br label %150

44:                                               ; preds = %0
  %45 = load i64, ptr @x, align 8, !tbaa !8
  %46 = load i64, ptr @y, align 8, !tbaa !8
  %47 = icmp sgt i64 %45, %46
  br i1 %47, label %48, label %76

48:                                               ; preds = %44
  %49 = load i64, ptr @k, align 8, !tbaa !8
  %50 = load i64, ptr @y, align 8, !tbaa !8
  %51 = add nsw i64 %49, %50
  %52 = load i64, ptr @r, align 8, !tbaa !8
  %53 = icmp sgt i64 %51, %52
  br i1 %53, label %54, label %58

54:                                               ; preds = %48
  %55 = load i64, ptr @y, align 8, !tbaa !8
  %56 = load i64, ptr @k, align 8, !tbaa !8
  %57 = sub nsw i64 %56, %55
  store i64 %57, ptr @k, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %54, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %59 = load i64, ptr @k, align 8, !tbaa !8
  %60 = load i64, ptr @l, align 8, !tbaa !8
  %61 = sub nsw i64 %59, %60
  store i64 %61, ptr %2, align 8, !tbaa !8
  %62 = load i64, ptr %2, align 8, !tbaa !8
  %63 = load i64, ptr @x, align 8, !tbaa !8
  %64 = load i64, ptr @y, align 8, !tbaa !8
  %65 = sub nsw i64 %63, %64
  %66 = sdiv i64 %62, %65
  %67 = load i64, ptr @t, align 8, !tbaa !8
  %68 = icmp sge i64 %66, %67
  br i1 %68, label %69, label %72

69:                                               ; preds = %58
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @.str.2)
  br label %75

72:                                               ; preds = %58
  %73 = 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)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @.str.2)
  br label %75

75:                                               ; preds = %72, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %149

76:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %77 = load i64, ptr @r, align 8, !tbaa !8
  %78 = load i64, ptr @y, align 8, !tbaa !8
  %79 = sub nsw i64 %77, %78
  store i64 %79, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  store i8 1, ptr %4, align 1, !tbaa !11
  %80 = load i64, ptr @k, align 8, !tbaa !8
  %81 = load i64, ptr %3, align 8, !tbaa !8
  %82 = icmp sle i64 %80, %81
  br i1 %82, label %83, label %87

83:                                               ; preds = %76
  %84 = load i64, ptr @y, align 8, !tbaa !8
  %85 = load i64, ptr @k, align 8, !tbaa !8
  %86 = add nsw i64 %85, %84
  store i64 %86, ptr @k, align 8, !tbaa !8
  br label %87

87:                                               ; preds = %83, %76
  br label %88

88:                                               ; preds = %141, %87
  %89 = load i64, ptr @t, align 8, !tbaa !8
  %90 = icmp sgt i64 %89, 0
  br i1 %90, label %91, label %142

91:                                               ; preds = %88
  %92 = load i64, ptr @x, align 8, !tbaa !8
  %93 = load i64, ptr @k, align 8, !tbaa !8
  %94 = sub nsw i64 %93, %92
  store i64 %94, ptr @k, align 8, !tbaa !8
  %95 = load i64, ptr @t, align 8, !tbaa !8
  %96 = add nsw i64 %95, -1
  store i64 %96, ptr @t, align 8, !tbaa !8
  %97 = load i64, ptr @t, align 8, !tbaa !8
  %98 = icmp eq i64 %97, 0
  br i1 %98, label %106, label %99

99:                                               ; preds = %91
  %100 = load i64, ptr @k, align 8, !tbaa !8
  %101 = load i64, ptr @x, align 8, !tbaa !8
  %102 = srem i64 %100, %101
  %103 = getelementptr inbounds [1000000 x i8], ptr @dp, i64 0, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !11, !range !13, !noundef !14
  %105 = trunc i8 %104 to i1
  br i1 %105, label %106, label %107

106:                                              ; preds = %99, %91
  br label %142

107:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %108 = load i64, ptr @k, align 8, !tbaa !8
  %109 = load i64, ptr %3, align 8, !tbaa !8
  %110 = sub nsw i64 %108, %109
  %111 = load i64, ptr @x, align 8, !tbaa !8
  %112 = add nsw i64 %110, %111
  %113 = sub nsw i64 %112, 1
  %114 = load i64, ptr @x, align 8, !tbaa !8
  %115 = sdiv i64 %113, %114
  store i64 %115, ptr %7, align 8, !tbaa !8
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @t, ptr noundef nonnull align 8 dereferenceable(8) %116)
  %118 = load i64, ptr %117, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  store i64 %118, ptr %5, align 8, !tbaa !8
  %119 = load i64, ptr %5, align 8, !tbaa !8
  %120 = load i64, ptr @x, align 8, !tbaa !8
  %121 = mul nsw i64 %119, %120
  %122 = load i64, ptr @k, align 8, !tbaa !8
  %123 = sub nsw i64 %122, %121
  store i64 %123, ptr @k, align 8, !tbaa !8
  %124 = load i64, ptr %5, align 8, !tbaa !8
  %125 = load i64, ptr @t, align 8, !tbaa !8
  %126 = sub nsw i64 %125, %124
  store i64 %126, ptr @t, align 8, !tbaa !8
  %127 = load i64, ptr @k, align 8, !tbaa !8
  %128 = load i64, ptr @l, align 8, !tbaa !8
  %129 = icmp slt i64 %127, %128
  br i1 %129, label %130, label %131

130:                                              ; preds = %107
  store i8 0, ptr %4, align 1, !tbaa !11
  store i32 3, ptr %8, align 4
  br label %139

131:                                              ; preds = %107
  %132 = load i64, ptr @k, align 8, !tbaa !8
  %133 = load i64, ptr @x, align 8, !tbaa !8
  %134 = srem i64 %132, %133
  %135 = getelementptr inbounds [1000000 x i8], ptr @dp, i64 0, i64 %134
  store i8 1, ptr %135, align 1, !tbaa !11
  %136 = load i64, ptr @y, align 8, !tbaa !8
  %137 = load i64, ptr @k, align 8, !tbaa !8
  %138 = add nsw i64 %137, %136
  store i64 %138, ptr @k, align 8, !tbaa !8
  store i32 0, ptr %8, align 4
  br label %139

139:                                              ; preds = %131, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %140 = load i32, ptr %8, align 4
  switch i32 %140, label %152 [
    i32 0, label %141
    i32 3, label %142
  ]

141:                                              ; preds = %139
  br label %88, !llvm.loop !15

142:                                              ; preds = %139, %106, %88
  %143 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %144 = trunc i8 %143 to i1
  %145 = zext i1 %144 to i64
  %146 = select i1 %144, ptr @.str, ptr @.str.1
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %146)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %149

149:                                              ; preds = %142, %75
  br label %150

150:                                              ; preds = %149, %34
  %151 = load i32, ptr %1, align 4
  ret i32 %151

152:                                              ; preds = %139
  unreachable
}

; 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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

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

; 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)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"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" }

@k = external dso_local global i64, align 8
@l = external dso_local global i64, align 8
@r = external dso_local global i64, align 8
@t = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@dp = external dso_local local_unnamed_addr global [1000000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; 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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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) @k)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @l)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @r)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @t)
  %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) @x)
  %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) @y)
  %15 = load i64, ptr @x, align 8, !tbaa !8
  %16 = load i64, ptr @y, align 8, !tbaa !8
  %17 = icmp eq i64 %15, %16
  br i1 %17, label %18, label %30

18:                                               ; preds = %0
  %19 = load i64, ptr @k, align 8, !tbaa !8
  %20 = add nsw i64 %19, %15
  %21 = load i64, ptr @r, align 8, !tbaa !8
  %.not16 = icmp sgt i64 %20, %21
  br i1 %.not16, label %23, label %22

22:                                               ; preds = %18
  store i64 %20, ptr @k, align 8, !tbaa !8
  br label %23

23:                                               ; preds = %22, %18
  %24 = phi i64 [ %20, %22 ], [ %19, %18 ]
  %25 = sub nsw i64 %24, %15
  %26 = load i64, ptr @l, align 8, !tbaa !8
  %.not17 = icmp slt i64 %25, %26
  %27 = select i1 %.not17, ptr @.str.1, ptr @.str
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %27)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.2)
  br label %97

30:                                               ; preds = %0
  %31 = icmp sgt i64 %15, %16
  br i1 %31, label %32, label %52

32:                                               ; preds = %30
  %33 = load i64, ptr @k, align 8, !tbaa !8
  %34 = add nsw i64 %33, %16
  %35 = load i64, ptr @r, align 8, !tbaa !8
  %36 = icmp sgt i64 %34, %35
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = sub nsw i64 %33, %16
  store i64 %38, ptr @k, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %37, %32
  %40 = phi i64 [ %38, %37 ], [ %33, %32 ]
  %41 = load i64, ptr @l, align 8, !tbaa !8
  %42 = sub nsw i64 %40, %41
  %43 = sub nsw i64 %15, %16
  %44 = sdiv i64 %42, %43
  %45 = load i64, ptr @t, align 8, !tbaa !8
  %.not15 = icmp slt i64 %44, %45
  br i1 %.not15, label %49, label %46

46:                                               ; preds = %39
  %47 = tail 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)
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull @.str.2)
  br label %97

49:                                               ; preds = %39
  %50 = tail 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)
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @.str.2)
  br label %97

52:                                               ; preds = %30
  %53 = load i64, ptr @r, align 8, !tbaa !8
  %54 = sub nsw i64 %53, %16
  %55 = load i64, ptr @k, align 8, !tbaa !8
  %.not = icmp sgt i64 %55, %54
  br i1 %.not, label %58, label %56

56:                                               ; preds = %52
  %57 = add nsw i64 %55, %16
  store i64 %57, ptr @k, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %56, %52
  %59 = phi i64 [ %57, %56 ], [ %55, %52 ]
  %60 = load i64, ptr @t, align 8, !tbaa !8
  %61 = icmp sgt i64 %60, 0
  br i1 %61, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %58
  %62 = xor i64 %54, -1
  br label %63

63:                                               ; preds = %.lr.ph, %89
  %64 = phi i64 [ %59, %.lr.ph ], [ %93, %89 ]
  %65 = phi i64 [ %15, %.lr.ph ], [ %81, %89 ]
  %66 = phi i64 [ %60, %.lr.ph ], [ %86, %89 ]
  %67 = sub nsw i64 %64, %65
  store i64 %67, ptr @k, align 8, !tbaa !8
  %68 = add nsw i64 %66, -1
  store i64 %68, ptr @t, align 8, !tbaa !8
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %.thread, label %70

70:                                               ; preds = %63
  %71 = srem i64 %67, %65
  %72 = getelementptr inbounds [1000000 x i8], ptr @dp, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11, !range !13, !noundef !14
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %.thread, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %76 = add i64 %64, %62
  %77 = sdiv i64 %76, %65
  store i64 %77, ptr %2, align 8, !tbaa !8
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @t, ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = load i64, ptr %79, 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
  %81 = load i64, ptr @x, align 8, !tbaa !8
  %82 = mul nsw i64 %81, %80
  %83 = load i64, ptr @k, align 8, !tbaa !8
  %84 = sub nsw i64 %83, %82
  store i64 %84, ptr @k, align 8, !tbaa !8
  %85 = load i64, ptr @t, align 8, !tbaa !8
  %86 = sub nsw i64 %85, %80
  store i64 %86, ptr @t, align 8, !tbaa !8
  %87 = load i64, ptr @l, align 8, !tbaa !8
  %88 = icmp slt i64 %84, %87
  br i1 %88, label %.thread, label %89

89:                                               ; preds = %75
  %90 = srem i64 %84, %81
  %91 = getelementptr inbounds [1000000 x i8], ptr @dp, i64 0, i64 %90
  store i8 1, ptr %91, align 1, !tbaa !11
  %92 = load i64, ptr @y, align 8, !tbaa !8
  %93 = add nsw i64 %92, %84
  store i64 %93, ptr @k, align 8, !tbaa !8
  %94 = icmp sgt i64 %86, 0
  br i1 %94, label %63, label %.thread

.thread:                                          ; preds = %89, %70, %63, %75, %58
  %.2 = phi ptr [ @.str, %58 ], [ @.str.1, %75 ], [ @.str, %63 ], [ @.str, %70 ], [ @.str, %89 ]
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.2)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull @.str.2)
  br label %97

97:                                               ; preds = %46, %49, %.thread, %23
  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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

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

; 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 #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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