; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x42-树状数组/243. 一个简单的整数问题2 (main)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@z = external dso_local global i64, align 8
@a = external dso_local global [100010 x i64], align 16
@sum = external dso_local global [100010 x i64], align 16
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3askii(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 nounwind uwtable
declare dso_local void @_Z3addiii(i32 noundef, i32 noundef, i32 noundef) #0

; 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
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %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) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %35, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = load i64, ptr @n, align 8, !tbaa !9
  %15 = icmp sle i64 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %11
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %19
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sub nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = add nsw i64 %26, %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %33
  store i64 %31, ptr %34, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %17
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

38:                                               ; preds = %16
  br label %39

39:                                               ; preds = %120, %38
  %40 = load i64, ptr @m, align 8, !tbaa !9
  %41 = add nsw i64 %40, -1
  store i64 %41, ptr @m, align 8, !tbaa !9
  %42 = icmp ne i64 %40, 0
  br i1 %42, label %43, label %121

43:                                               ; preds = %39
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %45 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %46 = load i8, ptr %45, align 1, !tbaa !13
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 81
  br i1 %48, label %49, label %91

49:                                               ; preds = %43
  %50 = 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)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 8 dereferenceable(8) @y)
  %52 = load i64, ptr @x, align 8, !tbaa !9
  %53 = add nsw i64 %52, -1
  store i64 %53, ptr @x, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %54 = load i64, ptr @x, align 8, !tbaa !9
  %55 = trunc i64 %54 to i32
  %56 = call noundef i64 @_Z3askii(i32 noundef 0, i32 noundef %55)
  store i64 %56, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %57 = load i64, ptr @x, align 8, !tbaa !9
  %58 = trunc i64 %57 to i32
  %59 = call noundef i64 @_Z3askii(i32 noundef 1, i32 noundef %58)
  store i64 %59, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %60 = load i64, ptr @x, align 8, !tbaa !9
  %61 = add nsw i64 %60, 1
  %62 = load i64, ptr %3, align 8, !tbaa !9
  %63 = mul nsw i64 %61, %62
  %64 = load i64, ptr %4, align 8, !tbaa !9
  %65 = sub nsw i64 %63, %64
  store i64 %65, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %66 = load i64, ptr @y, align 8, !tbaa !9
  %67 = trunc i64 %66 to i32
  %68 = call noundef i64 @_Z3askii(i32 noundef 0, i32 noundef %67)
  store i64 %68, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %69 = load i64, ptr @y, align 8, !tbaa !9
  %70 = trunc i64 %69 to i32
  %71 = call noundef i64 @_Z3askii(i32 noundef 1, i32 noundef %70)
  store i64 %71, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %72 = load i64, ptr @y, align 8, !tbaa !9
  %73 = add nsw i64 %72, 1
  %74 = load i64, ptr %6, align 8, !tbaa !9
  %75 = mul nsw i64 %73, %74
  %76 = load i64, ptr %7, align 8, !tbaa !9
  %77 = sub nsw i64 %75, %76
  store i64 %77, ptr %8, align 8, !tbaa !9
  %78 = load i64, ptr %8, align 8, !tbaa !9
  %79 = load i64, ptr %5, align 8, !tbaa !9
  %80 = sub nsw i64 %78, %79
  %81 = load i64, ptr @y, align 8, !tbaa !9
  %82 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = load i64, ptr @x, align 8, !tbaa !9
  %85 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = sub nsw i64 %83, %86
  %88 = add nsw i64 %80, %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %88)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  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 %120

91:                                               ; preds = %43
  %92 = 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)
  %93 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %92, ptr noundef nonnull align 8 dereferenceable(8) @y)
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %93, ptr noundef nonnull align 8 dereferenceable(8) @z)
  %95 = load i64, ptr @x, align 8, !tbaa !9
  %96 = trunc i64 %95 to i32
  %97 = load i64, ptr @z, align 8, !tbaa !9
  %98 = trunc i64 %97 to i32
  call void @_Z3addiii(i32 noundef 0, i32 noundef %96, i32 noundef %98)
  %99 = load i64, ptr @y, align 8, !tbaa !9
  %100 = add nsw i64 %99, 1
  %101 = trunc i64 %100 to i32
  %102 = load i64, ptr @z, align 8, !tbaa !9
  %103 = sub nsw i64 0, %102
  %104 = trunc i64 %103 to i32
  call void @_Z3addiii(i32 noundef 0, i32 noundef %101, i32 noundef %104)
  %105 = load i64, ptr @x, align 8, !tbaa !9
  %106 = trunc i64 %105 to i32
  %107 = load i64, ptr @x, align 8, !tbaa !9
  %108 = load i64, ptr @z, align 8, !tbaa !9
  %109 = mul nsw i64 %107, %108
  %110 = trunc i64 %109 to i32
  call void @_Z3addiii(i32 noundef 1, i32 noundef %106, i32 noundef %110)
  %111 = load i64, ptr @y, align 8, !tbaa !9
  %112 = add nsw i64 %111, 1
  %113 = trunc i64 %112 to i32
  %114 = load i64, ptr @y, align 8, !tbaa !9
  %115 = add nsw i64 %114, 1
  %116 = sub nsw i64 0, %115
  %117 = load i64, ptr @z, align 8, !tbaa !9
  %118 = mul nsw i64 %116, %117
  %119 = trunc i64 %118 to i32
  call void @_Z3addiii(i32 noundef 1, i32 noundef %113, i32 noundef %119)
  br label %120

120:                                              ; preds = %91, %49
  br label %39, !llvm.loop !14

121:                                              ; preds = %39
  ret i32 0
}

; 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 align 2

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@z = external dso_local global i64, align 8
@a = external dso_local global [100010 x i64], align 16
@sum = external dso_local local_unnamed_addr global [100010 x i64], align 16
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addiii(i32 noundef, 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 nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %3 = load i64, ptr @n, align 8, !tbaa !5
  %.not18 = icmp slt i64 %3, 1
  br i1 %.not18, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %0
  %4 = load i64, ptr @m, align 8, !tbaa !5
  %5 = add nsw i64 %4, -1
  store i64 %5, ptr @m, align 8, !tbaa !5
  %.not1320 = icmp eq i64 %4, 0
  br i1 %.not1320, label %._crit_edge, label %.lr.ph21

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %6 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv
  %7 = 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) %6)
  %8 = add nsw i64 %indvars.iv, -1
  %9 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %8
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = load i64, ptr %6, align 8, !tbaa !5
  %12 = add nsw i64 %11, %10
  %13 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv
  store i64 %12, ptr %13, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i64, ptr @n, align 8, !tbaa !5
  %.not.not = icmp sgt i64 %14, %indvars.iv
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph21:                                         ; preds = %.preheader, %74
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %16 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %17 = load i8, ptr %16, align 1, !tbaa !11
  %18 = icmp eq i8 %17, 81
  %19 = 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) @x)
  %20 = tail 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)
  br i1 %18, label %21, label %50

21:                                               ; preds = %.lr.ph21
  %22 = load i64, ptr @x, align 8, !tbaa !5
  %23 = add nsw i64 %22, -1
  store i64 %23, ptr @x, align 8, !tbaa !5
  %24 = trunc i64 %23 to i32
  %25 = tail call noundef i64 @_Z3askii(i32 noundef 0, i32 noundef %24)
  %26 = load i64, ptr @x, align 8, !tbaa !5
  %27 = trunc i64 %26 to i32
  %28 = tail call noundef i64 @_Z3askii(i32 noundef 1, i32 noundef %27)
  %29 = load i64, ptr @x, align 8, !tbaa !5
  %.neg14 = xor i64 %29, -1
  %.neg15 = mul i64 %25, %.neg14
  %30 = load i64, ptr @y, align 8, !tbaa !5
  %31 = trunc i64 %30 to i32
  %32 = tail call noundef i64 @_Z3askii(i32 noundef 0, i32 noundef %31)
  %33 = load i64, ptr @y, align 8, !tbaa !5
  %34 = trunc i64 %33 to i32
  %35 = tail call noundef i64 @_Z3askii(i32 noundef 1, i32 noundef %34)
  %36 = load i64, ptr @y, align 8, !tbaa !5
  %37 = add nsw i64 %36, 1
  %38 = mul nsw i64 %37, %32
  %39 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %36
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = load i64, ptr @x, align 8, !tbaa !5
  %42 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = add i64 %.neg15, %28
  %45 = sub i64 %44, %35
  %.neg = add i64 %45, %40
  %46 = add i64 %.neg, %38
  %47 = sub i64 %46, %43
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %47)
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %74

50:                                               ; preds = %.lr.ph21
  %51 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @z)
  %52 = load i64, ptr @x, align 8, !tbaa !5
  %53 = trunc i64 %52 to i32
  %54 = load i64, ptr @z, align 8, !tbaa !5
  %55 = trunc i64 %54 to i32
  tail call void @_Z3addiii(i32 noundef 0, i32 noundef %53, i32 noundef %55)
  %56 = load i64, ptr @y, align 8, !tbaa !5
  %57 = trunc i64 %56 to i32
  %58 = add i32 %57, 1
  %59 = load i64, ptr @z, align 8, !tbaa !5
  %60 = trunc i64 %59 to i32
  %61 = sub i32 0, %60
  tail call void @_Z3addiii(i32 noundef 0, i32 noundef %58, i32 noundef %61)
  %62 = load i64, ptr @x, align 8, !tbaa !5
  %63 = trunc i64 %62 to i32
  %64 = load i64, ptr @z, align 8, !tbaa !5
  %65 = mul nsw i64 %64, %62
  %66 = trunc i64 %65 to i32
  tail call void @_Z3addiii(i32 noundef 1, i32 noundef %63, i32 noundef %66)
  %67 = load i64, ptr @y, align 8, !tbaa !5
  %68 = trunc i64 %67 to i32
  %69 = add i32 %68, 1
  %70 = xor i64 %67, -1
  %71 = load i64, ptr @z, align 8, !tbaa !5
  %72 = mul nsw i64 %71, %70
  %73 = trunc i64 %72 to i32
  tail call void @_Z3addiii(i32 noundef 1, i32 noundef %69, i32 noundef %73)
  br label %74

74:                                               ; preds = %50, %21
  %75 = load i64, ptr @m, align 8, !tbaa !5
  %76 = add nsw i64 %75, -1
  store i64 %76, ptr @m, align 8, !tbaa !5
  %.not13 = icmp eq i64 %75, 0
  br i1 %.not13, label %._crit_edge, label %.lr.ph21, !llvm.loop !12

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

; 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 #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

; 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 #2 align 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 #2 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

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


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