; LLVM IR from tangjz/acm-icpc :: self_training/2015-09-24/G.ll (Z3dfsiSt4pairIxxE)

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

@rt = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@idx = external dso_local global i32, align 4
@ans = external dso_local global i64, align 8
@w = external dso_local global [10 x [10 x %"struct.std::pair"]], align 16
@tmp = external dso_local global %"struct.std::pair", align 8
@vis = external dso_local global [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpSt4pairIxxES0_(i64, i64, i64, i64) #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 uwtable
define dso_local void @_Z3dfsiSt4pairIxxE(i32 noundef %0, i64 %1, i64 %2) #0 {
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  store i64 %1, ptr %18, align 8
  %19 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  store i64 %2, ptr %19, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10 x i8], ptr @vis, i64 0, i64 %21
  store i8 1, ptr %22, align 1, !tbaa !9
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load i32, ptr @rt, align 4, !tbaa !5
  %25 = icmp ne i32 %23, %24
  br i1 %25, label %26, label %79

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %27 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = sub nsw i64 %28, 1
  %30 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !14
  %32 = sdiv i64 %29, %31
  %33 = add nsw i64 %32, 1
  store i64 %33, ptr %6, align 8, !tbaa !15
  %34 = load i64, ptr %6, align 8, !tbaa !15
  %35 = icmp sle i64 %34, 100000
  br i1 %35, label %36, label %78

36:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %37 = load i64, ptr %6, align 8, !tbaa !15
  %38 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %39 = load i64, ptr %38, align 8, !tbaa !14
  %40 = mul nsw i64 %37, %39
  %41 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %43 = sub nsw i64 %40, %42
  store i64 %43, ptr %8, align 8, !tbaa !15
  %44 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 0
  %45 = call { i64, i64 } @_ZSt9make_pairIxRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  %47 = extractvalue { i64, i64 } %45, 0
  store i64 %47, ptr %46, align 8
  %48 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  %49 = extractvalue { i64, i64 } %45, 1
  store i64 %49, ptr %48, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %50 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %53 = load i64, ptr %52, align 8, !tbaa !14
  %54 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %51, i64 noundef %53)
  store i64 %54, ptr %9, align 8, !tbaa !15
  %55 = load i64, ptr %9, align 8, !tbaa !15
  %56 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 0
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = sdiv i64 %57, %55
  store i64 %58, ptr %56, align 8, !tbaa !11
  %59 = load i64, ptr %9, align 8, !tbaa !15
  %60 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %61 = load i64, ptr %60, align 8, !tbaa !14
  %62 = sdiv i64 %61, %59
  store i64 %62, ptr %60, align 8, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %7, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @tmp, i64 16, i1 false)
  %63 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %64 = load i64, ptr %63, align 8
  %65 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %66 = load i64, ptr %65, align 8
  %67 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %68 = load i64, ptr %67, align 8
  %69 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %70 = load i64, ptr %69, align 8
  %71 = call noundef i32 @_Z4dcmpSt4pairIxxES0_(i64 %64, i64 %66, i64 %68, i64 %70)
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %36
  %74 = load i64, ptr %6, align 8, !tbaa !15
  store i64 %74, ptr @ans, align 8, !tbaa !15
  %75 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %75, ptr @idx, align 4, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) @tmp, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br label %77

77:                                               ; preds = %73, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  br label %78

78:                                               ; preds = %77, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %79

79:                                               ; preds = %78, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %148, %79
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr @tot, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %151

85:                                               ; preds = %80
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x i8], ptr @vis, i64 0, i64 %87
  %89 = load i8, ptr %88, align 1, !tbaa !9, !range !16, !noundef !17
  %90 = trunc i8 %89 to i1
  br i1 %90, label %147, label %91

91:                                               ; preds = %85
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10 x [10 x %"struct.std::pair"]], ptr @w, i64 0, i64 %93
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10 x %"struct.std::pair"], ptr %94, i64 0, i64 %96
  %98 = getelementptr inbounds %"struct.std::pair", ptr %97, i32 0, i32 1
  %99 = load i64, ptr %98, align 8, !tbaa !14
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %101, label %147

101:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %102 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 0
  %103 = load i64, ptr %102, align 8, !tbaa !11
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [10 x [10 x %"struct.std::pair"]], ptr @w, i64 0, i64 %105
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10 x %"struct.std::pair"], ptr %106, i64 0, i64 %108
  %110 = getelementptr inbounds %"struct.std::pair", ptr %109, i32 0, i32 0
  %111 = load i64, ptr %110, align 16, !tbaa !11
  %112 = mul nsw i64 %103, %111
  store i64 %112, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %113 = getelementptr inbounds %"struct.std::pair", ptr %4, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !14
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10 x [10 x %"struct.std::pair"]], ptr @w, i64 0, i64 %116
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [10 x %"struct.std::pair"], ptr %117, i64 0, i64 %119
  %121 = getelementptr inbounds %"struct.std::pair", ptr %120, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !14
  %123 = mul nsw i64 %114, %122
  store i64 %123, ptr %15, align 8, !tbaa !15
  %124 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %125 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %126 = extractvalue { i64, i64 } %124, 0
  store i64 %126, ptr %125, align 8
  %127 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %128 = extractvalue { i64, i64 } %124, 1
  store i64 %128, ptr %127, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %129 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %130 = load i64, ptr %129, align 8, !tbaa !11
  %131 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %132 = load i64, ptr %131, align 8, !tbaa !14
  %133 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %130, i64 noundef %132)
  store i64 %133, ptr %16, align 8, !tbaa !15
  %134 = load i64, ptr %16, align 8, !tbaa !15
  %135 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %136 = load i64, ptr %135, align 8, !tbaa !11
  %137 = sdiv i64 %136, %134
  store i64 %137, ptr %135, align 8, !tbaa !11
  %138 = load i64, ptr %16, align 8, !tbaa !15
  %139 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %140 = load i64, ptr %139, align 8, !tbaa !14
  %141 = sdiv i64 %140, %138
  store i64 %141, ptr %139, align 8, !tbaa !14
  %142 = load i32, ptr %12, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %13, i64 16, i1 false)
  %143 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %144 = load i64, ptr %143, align 8
  %145 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %146 = load i64, ptr %145, align 8
  call void @_Z3dfsiSt4pairIxxE(i32 noundef %142, i64 %144, i64 %146)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br label %147

147:                                              ; preds = %101, %91, %85
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %12, align 4, !tbaa !5
  br label %80, !llvm.loop !18

151:                                              ; preds = %84
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIxRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !13, i64 0, !13, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!13, !13, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"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"

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

@rt = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@idx = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i64, align 8
@w = external dso_local local_unnamed_addr global [10 x [10 x %"struct.std::pair"]], align 16
@tmp = external dso_local global %"struct.std::pair", align 8
@vis = external dso_local local_unnamed_addr global [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpSt4pairIxxES0_(i64, i64, i64, i64) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsiSt4pairIxxE(i32 noundef %0, i64 %1, i64 %2) local_unnamed_addr #0 {
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i64 %1, ptr %4, align 8
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %2, ptr %9, align 8
  %10 = sext i32 %0 to i64
  %11 = getelementptr inbounds [10 x i8], ptr @vis, i64 0, i64 %10
  store i8 1, ptr %11, align 1, !tbaa !5
  %12 = load i32, ptr @rt, align 4, !tbaa !9
  %.not = icmp eq i32 %12, %0
  br i1 %.not, label %33, label %13

13:                                               ; preds = %3
  %14 = add nsw i64 %1, -1
  %15 = sdiv i64 %14, %2
  %16 = add nsw i64 %15, 1
  %17 = icmp slt i64 %15, 100000
  br i1 %17, label %18, label %33

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %19 = mul nsw i64 %16, %2
  %20 = sub nsw i64 %19, %1
  store i64 %20, ptr %6, align 8, !tbaa !11
  %21 = call { i64, i64 } @_ZSt9make_pairIxRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %22 = extractvalue { i64, i64 } %21, 0
  %23 = getelementptr inbounds i8, ptr %5, i64 8
  %24 = extractvalue { i64, i64 } %21, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %25 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %22, i64 noundef %24)
  %26 = sdiv i64 %22, %25
  store i64 %26, ptr %5, align 8, !tbaa !13
  %27 = sdiv i64 %24, %25
  store i64 %27, ptr %23, align 8, !tbaa !15
  %.sroa.014.0.copyload = load i64, ptr @tmp, align 8
  %.sroa.215.0.copyload = load i64, ptr getelementptr inbounds (i8, ptr @tmp, i64 8), align 8
  %28 = call noundef i32 @_Z4dcmpSt4pairIxxES0_(i64 %26, i64 %27, i64 %.sroa.014.0.copyload, i64 %.sroa.215.0.copyload)
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %18
  store i64 %16, ptr @ans, align 8, !tbaa !11
  store i32 %0, ptr @idx, align 4, !tbaa !9
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) @tmp, ptr noundef nonnull align 8 dereferenceable(16) %5)
  br label %32

32:                                               ; preds = %30, %18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %33

33:                                               ; preds = %13, %32, %3
  %34 = load i32, ptr @tot, align 4, !tbaa !9
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %57, %33
  ret void

.lr.ph:                                           ; preds = %33, %57
  %36 = phi i32 [ %58, %57 ], [ %34, %33 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %57 ], [ 0, %33 ]
  %37 = getelementptr inbounds [10 x i8], ptr @vis, i64 0, i64 %indvars.iv
  %38 = load i8, ptr %37, align 1, !tbaa !5, !range !16, !noundef !17
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %57, label %40

40:                                               ; preds = %.lr.ph
  %41 = getelementptr inbounds [10 x [10 x %"struct.std::pair"]], ptr @w, i64 0, i64 %10, i64 %indvars.iv
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i64, ptr %42, align 8, !tbaa !15
  %.not31 = icmp eq i64 %43, 0
  br i1 %.not31, label %57, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %45 = load i64, ptr %4, align 8, !tbaa !13
  %46 = load i64, ptr %41, align 16, !tbaa !13
  %47 = mul nsw i64 %46, %45
  store i64 %47, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %48 = load i64, ptr %9, align 8, !tbaa !15
  %49 = mul nsw i64 %48, %43
  store i64 %49, ptr %8, align 8, !tbaa !11
  %50 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %51 = extractvalue { i64, i64 } %50, 0
  %52 = extractvalue { i64, i64 } %50, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %53 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %51, i64 noundef %52)
  %54 = sdiv i64 %51, %53
  %55 = sdiv i64 %52, %53
  %56 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z3dfsiSt4pairIxxE(i32 noundef %56, i64 %54, i64 %55)
  %.pre = load i32, ptr @tot, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %.lr.ph, %40, %44
  %58 = phi i32 [ %36, %.lr.ph ], [ %36, %40 ], [ %.pre, %44 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next, %59
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !18
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIxRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = !{!"bool", !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, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSSt4pairIxxE", !12, i64 0, !12, i64 8}
!15 = !{!14, !12, i64 8}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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