; LLVM IR from tangjz/acm-icpc :: 51nod (1151)

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

%"struct.std::pair" = type { i64, i64 }

@p = external dso_local global i32, align 4
@pp = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@mod = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7mod_mulxxx(i64 noundef, i64 noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z8mod_factx(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4initii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkSt4pairIxxE(i64, i64) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  store i64 0, ptr @ans, align 8, !tbaa !5
  store i64 1, ptr @mod, align 8, !tbaa !5
  call void @_Z4initii(i32 noundef 2, i32 noundef 18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #8
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = call { i64, i64 } @_Z8mod_factx(i64 noundef %12)
  %14 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 0
  %15 = extractvalue { i64, i64 } %13, 0
  store i64 %15, ptr %14, align 8
  %16 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 1
  %17 = extractvalue { i64, i64 } %13, 1
  store i64 %17, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %18 = load i32, ptr @p, align 4, !tbaa !9
  store i32 %18, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %19 = load i64, ptr @pp, align 8, !tbaa !5
  store i64 %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %3, i64 16, i1 false)
  call void @_Z4initii(i32 noundef 5, i32 noundef 18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = call { i64, i64 } @_Z8mod_factx(i64 noundef %20)
  %22 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  %23 = extractvalue { i64, i64 } %21, 0
  store i64 %23, ptr %22, align 8
  %24 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  %25 = extractvalue { i64, i64 } %21, 1
  store i64 %25, ptr %24, align 8
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %27 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %28 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %29, align 8, !tbaa !5
  store i64 %30, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = load i64, ptr @pp, align 8, !tbaa !5
  %37 = call noundef i64 @_Z7mod_powxxx(i64 noundef %34, i64 noundef %35, i64 noundef %36)
  %38 = load i64, ptr @pp, align 8, !tbaa !5
  %39 = call noundef i64 @_Z7mod_invxx(i64 noundef %37, i64 noundef %38)
  %40 = load i64, ptr @pp, align 8, !tbaa !5
  %41 = call noundef i64 @_Z7mod_mulxxx(i64 noundef %32, i64 noundef %39, i64 noundef %40)
  %42 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  store i64 %41, ptr %42, align 8, !tbaa !11
  %43 = load i64, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = sub nsw i64 %45, %43
  store i64 %46, ptr %44, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %3, i64 16, i1 false)
  %47 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %48 = load i64, ptr %47, align 8
  %49 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %50 = load i64, ptr %49, align 8
  call void @_Z5checkSt4pairIxxE(i64 %48, i64 %50)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @p, ptr noundef nonnull align 4 dereferenceable(4) %4) #8
  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) @pp, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @_ZSt4swapIxxENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  %51 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = load i64, ptr %8, align 8, !tbaa !5
  %56 = load i64, ptr @pp, align 8, !tbaa !5
  %57 = call noundef i64 @_Z7mod_powxxx(i64 noundef %54, i64 noundef %55, i64 noundef %56)
  %58 = load i64, ptr @pp, align 8, !tbaa !5
  %59 = call noundef i64 @_Z7mod_invxx(i64 noundef %57, i64 noundef %58)
  %60 = load i64, ptr @pp, align 8, !tbaa !5
  %61 = call noundef i64 @_Z7mod_mulxxx(i64 noundef %52, i64 noundef %59, i64 noundef %60)
  %62 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  store i64 %61, ptr %62, align 8, !tbaa !11
  %63 = load i64, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !13
  %66 = sub nsw i64 %65, %63
  store i64 %66, ptr %64, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %3, i64 16, i1 false)
  %67 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %68 = load i64, ptr %67, align 8
  %69 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %70 = load i64, ptr %69, align 8
  call void @_Z5checkSt4pairIxxE(i64 %68, i64 %70)
  %71 = load i64, ptr @ans, align 8, !tbaa !5
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %71)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6 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)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z7mod_invxx(i64 noundef, i64 noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7mod_powxxx(i64 noundef, i64 noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

declare i32 @printf(ptr noundef, ...) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { "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 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 = { 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 #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}


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

%"struct.std::pair" = type { i64, i64 }

@p = external dso_local global i32, align 4
@pp = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@mod = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7mod_mulxxx(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z8mod_factx(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4initii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkSt4pairIxxE(i64, i64) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i64, align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  store i64 0, ptr @ans, align 8, !tbaa !5
  store i64 1, ptr @mod, align 8, !tbaa !5
  call void @_Z4initii(i32 noundef 2, i32 noundef 18)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = call { i64, i64 } @_Z8mod_factx(i64 noundef %8)
  %10 = extractvalue { i64, i64 } %9, 0
  store i64 %10, ptr %2, align 8
  %11 = getelementptr inbounds i8, ptr %2, i64 8
  %12 = extractvalue { i64, i64 } %9, 1
  store i64 %12, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %13 = load i32, ptr @p, align 4, !tbaa !9
  store i32 %13, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %14 = load i64, ptr @pp, align 8, !tbaa !5
  store i64 %14, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %2, i64 16, i1 false)
  call void @_Z4initii(i32 noundef 5, i32 noundef 18)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = call { i64, i64 } @_Z8mod_factx(i64 noundef %15)
  %17 = extractvalue { i64, i64 } %16, 0
  store i64 %17, ptr %6, align 8
  %18 = getelementptr inbounds i8, ptr %6, i64 8
  %19 = extractvalue { i64, i64 } %16, 1
  store i64 %19, ptr %18, align 8
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = load i64, ptr %2, align 8, !tbaa !11
  %25 = sext i32 %13 to i64
  %26 = load i64, ptr @pp, align 8, !tbaa !5
  %27 = call noundef i64 @_Z7mod_powxxx(i64 noundef %25, i64 noundef %23, i64 noundef %26)
  %28 = load i64, ptr @pp, align 8, !tbaa !5
  %29 = call noundef i64 @_Z7mod_invxx(i64 noundef %27, i64 noundef %28)
  %30 = load i64, ptr @pp, align 8, !tbaa !5
  %31 = call noundef i64 @_Z7mod_mulxxx(i64 noundef %24, i64 noundef %29, i64 noundef %30)
  store i64 %31, ptr %2, align 8, !tbaa !11
  %32 = load i64, ptr %11, align 8, !tbaa !13
  %33 = sub nsw i64 %32, %23
  store i64 %33, ptr %11, align 8, !tbaa !13
  call void @_Z5checkSt4pairIxxE(i64 %31, i64 %33)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @p, ptr noundef nonnull align 4 dereferenceable(4) %3) #8
  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) @pp, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @_ZSt4swapIxxENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  %34 = load i64, ptr %2, align 8, !tbaa !11
  %35 = load i32, ptr %3, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = load i64, ptr @pp, align 8, !tbaa !5
  %38 = call noundef i64 @_Z7mod_powxxx(i64 noundef %36, i64 noundef %23, i64 noundef %37)
  %39 = load i64, ptr @pp, align 8, !tbaa !5
  %40 = call noundef i64 @_Z7mod_invxx(i64 noundef %38, i64 noundef %39)
  %41 = load i64, ptr @pp, align 8, !tbaa !5
  %42 = call noundef i64 @_Z7mod_mulxxx(i64 noundef %34, i64 noundef %40, i64 noundef %41)
  store i64 %42, ptr %2, align 8, !tbaa !11
  %43 = load i64, ptr %11, align 8, !tbaa !13
  %44 = sub nsw i64 %43, %23
  store i64 %44, ptr %11, align 8, !tbaa !13
  call void @_Z5checkSt4pairIxxE(i64 %42, i64 %44)
  %45 = load i64, ptr @ans, align 8, !tbaa !5
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %45)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 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 #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z7mod_invxx(i64 noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7mod_powxxx(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { nofree nounwind "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 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 = { 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 #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}


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