; LLVM IR from tangjz/acm-icpc :: lydsy (5257)

; 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.BigInt = type { i32, i32, [10001 x i32] }

@n = external dso_local global %struct.BigInt, align 4
@A = external dso_local global %struct.BigInt, align 4
@B = external dso_local global %struct.BigInt, align 4
@tmp = external dso_local global %struct.BigInt, align 4
@tA = external dso_local global %struct.BigInt, align 4
@tB = external dso_local global %struct.BigInt, align 4
@ans = external dso_local global i32, align 4
@buf = external dso_local global [300001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @buf)
  call void @_ZN6BigInt6assignEPKc(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef @buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %16

16:                                               ; preds = %44, %0
  %17 = load i32, ptr @n, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %23, label %19

19:                                               ; preds = %16
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @A, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp sge i32 %21, 122
  br i1 %22, label %23, label %28

23:                                               ; preds = %19, %16
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(40012) @A)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(40012) @B)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %24 = load i32, ptr @n, align 4, !tbaa !9
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  br label %47

27:                                               ; preds = %23
  br label %28

28:                                               ; preds = %27, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %29)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @n)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(40012) @A)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tA, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(4) %30)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @B)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  br label %31

31:                                               ; preds = %41, %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %33 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %33, ptr %9, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %44

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 3, ptr %11, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tA, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = sub nsw i32 0, %38
  %40 = and i32 %37, %39
  store i32 %40, ptr %12, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr @ans, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @ans, align 4, !tbaa !5
  br label %31, !llvm.loop !11

44:                                               ; preds = %35
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @tB)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(40012) @tA)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tA)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tB)
  %45 = load i32, ptr @ans, align 4, !tbaa !5
  %46 = add nsw i32 %45, 30
  store i32 %46, ptr @ans, align 4, !tbaa !5
  br label %16, !llvm.loop !13

47:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  store i64 %50, ptr %13, align 8, !tbaa !14
  br label %51

51:                                               ; preds = %68, %47
  %52 = load i64, ptr %13, align 8, !tbaa !14
  %53 = icmp ne i64 %52, 1
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %71

55:                                               ; preds = %51
  %56 = load i64, ptr %13, align 8, !tbaa !14
  %57 = and i64 %56, 1
  %58 = icmp ne i64 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %55
  %60 = load i64, ptr %13, align 8, !tbaa !14
  %61 = mul i64 %60, 3
  %62 = add i64 %61, 1
  br label %66

63:                                               ; preds = %55
  %64 = load i64, ptr %13, align 8, !tbaa !14
  %65 = lshr i64 %64, 1
  br label %66

66:                                               ; preds = %63, %59
  %67 = phi i64 [ %62, %59 ], [ %65, %63 ]
  store i64 %67, ptr %13, align 8, !tbaa !14
  br label %68

68:                                               ; preds = %66
  %69 = load i32, ptr @ans, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr @ans, align 4, !tbaa !5
  br label %51, !llvm.loop !16

71:                                               ; preds = %54
  %72 = load i32, ptr @ans, align 4, !tbaa !5
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %72)
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012), ptr noundef nonnull align 4 dereferenceable(40012)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012), ptr noundef nonnull align 4 dereferenceable(40012)) #5 align 2

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

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

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

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 = { "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 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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, !6, i64 0}
!10 = !{!"_ZTS6BigInt", !6, i64 0, !6, i64 4, !7, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !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"

%struct.BigInt = type { i32, i32, [10001 x i32] }

@n = external dso_local global %struct.BigInt, align 4
@A = external dso_local global %struct.BigInt, align 4
@B = external dso_local global %struct.BigInt, align 4
@tmp = external dso_local global %struct.BigInt, align 4
@tA = external dso_local global %struct.BigInt, align 4
@tB = external dso_local global %struct.BigInt, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@buf = external dso_local global [300001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @buf)
  tail call void @_ZN6BigInt6assignEPKc(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull @buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 1, ptr %1, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %13

13:                                               ; preds = %._crit_edge, %0
  %14 = load i32, ptr @n, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %20, label %16

16:                                               ; preds = %13
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @A, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 121
  br i1 %19, label %20, label %23

20:                                               ; preds = %16, %13
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(40012) @A)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(40012) @B)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %21 = load i32, ptr @n, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %39, label %23

23:                                               ; preds = %20, %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @n)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(40012) @A)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tA, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(4) %25)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @B)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %23
  call void @_ZN6BigInt13shiftRightOneEv(ptr noundef nonnull align 4 dereferenceable(40012) @tB)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @A, ptr noundef nonnull align 4 dereferenceable(40012) @tA)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tA)
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @B, ptr noundef nonnull align 4 dereferenceable(40012) @tB)
  %29 = load i32, ptr @ans, align 4, !tbaa !5
  %30 = add nsw i32 %29, 30
  store i32 %30, ptr @ans, align 4, !tbaa !5
  br label %13, !llvm.loop !11

.lr.ph:                                           ; preds = %23, %.lr.ph
  %31 = phi i32 [ %37, %.lr.ph ], [ %27, %23 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  store i32 3, ptr %9, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tA, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %32 = sub nsw i32 0, %31
  %33 = and i32 %31, %32
  store i32 %33, ptr %10, align 4, !tbaa !5
  call void @_ZN6BigInt6assignERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tmp, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(40012) @tmp)
  %34 = load i32, ptr @ans, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @tB, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !13

39:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6BigInt3getERKi(ptr noundef nonnull align 4 dereferenceable(40012) @n, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %41 = load i32, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %.not8 = icmp eq i32 %41, 1
  br i1 %.not8, label %43, label %.lr.ph11.preheader

.lr.ph11.preheader:                               ; preds = %39
  %42 = sext i32 %41 to i64
  br label %.lr.ph11

._crit_edge12:                                    ; preds = %.lr.ph11
  store i32 %52, ptr @ans, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %._crit_edge12, %39
  %44 = phi i32 [ %52, %._crit_edge12 ], [ %ans.promoted, %39 ]
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %44)
  ret i32 0

.lr.ph11:                                         ; preds = %.lr.ph11.preheader, %.lr.ph11
  %.09 = phi i64 [ %51, %.lr.ph11 ], [ %42, %.lr.ph11.preheader ]
  %46 = phi i32 [ %52, %.lr.ph11 ], [ %ans.promoted, %.lr.ph11.preheader ]
  %47 = and i64 %.09, 1
  %.not7 = icmp eq i64 %47, 0
  %48 = mul i64 %.09, 3
  %49 = add i64 %48, 1
  %50 = lshr exact i64 %.09, 1
  %51 = select i1 %.not7, i64 %50, i64 %49
  %52 = add nsw i32 %46, 1
  %.not = icmp eq i64 %51, 1
  br i1 %.not, label %._crit_edge12, label %.lr.ph11, !llvm.loop !14
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntmLERKS_(ptr noundef nonnull align 4 dereferenceable(40012), ptr noundef nonnull align 4 dereferenceable(40012)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntpLERKS_(ptr noundef nonnull align 4 dereferenceable(40012), ptr noundef nonnull align 4 dereferenceable(40012)) local_unnamed_addr #5 align 2

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

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

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

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


; Effective O3 passes: GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass