module Factwithmod
  implicit none
  integer(16),allocatable,dimension(:)::Kaijo,comb
  contains
subroutine initiationFactorial(maxnum,mo)
  implicit none
  integer(16)::maxnum
  integer(16)::mo
  integer(16)::i

  allocate(Kaijo(0:maxnum))
  Kaijo(0)=1
  do i=1,maxnum
    Kaijo(i)=mod(Kaijo(i-1)*i,mo)
  end do
end subroutine

subroutine combination(n,maxnum,l)
implicit none
integer(16),intent(in)::n,maxnum,l
integer(16)::i
allocate(comb(maxnum))
comb(1)=N
do i=2,maxnum
    comb(i)=comb(i-1)*(N-i+1)*inv(i,l)
    comb(i)=mod(comb(i),l)
end do
end subroutine

function inv(K,L)
integer(16),intent(in)::k,l
integer(16) l2,y
integer(16) inv
inv=1
l2=l-2
y=k
do
  if(mod(l2,2)==1)inv=mod(inv*y,l)
  y=mod(y*y,l)
  l2=l2/2
  if(l2==0)exit
end do
end function

function permutation(n,k,mo)
implicit none
  integer(16)::n,k
  integer(16)::mo,permutation
  permutation=mod(Kaijo(N)*inv(Kaijo(N-K),mo),mo)
end function
end module Factwithmod
program ABC156b
    use Factwithmod
    implicit none
    integer(16)::N
    integer(16)::a,b
    integer(16)::mo=10**9+7
    integer(16)::allc
    integer(16)::ans
    read*,N,a,b
    call combination(N,b,mo)
    allc=power_func(2_16,N,mo)-1_16
    ans=allc-comb(a)-comb(b)
    ans=mod(ans,mo)
    if(ans<0)ans=ans+mo
    print"(i0)",ans
contains
integer(16) function power_func(a,n,mo)
    integer(16)::a,n,mo
    integer(16)::l2,y
    power_func=1
    l2=N
    y=a
    do
        if(mod(l2,2)==1)power_func=mod(power_func*y,mo)
        y=mod(y*y,mo)
        l2=l2/2
        if(l2==0)exit
    end do
end function power_func
end program ABC156b
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QMfactwithmodEcomb = local_unnamed_addr global { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { ptr null, i64 ptrtoint (ptr getelementptr (i128, ptr null, i32 1) to i64), i32 20180515, i8 1, i8 11, i8 2, i8 0, [1 x [3 x i64]] [[3 x i64] [i64 1, i64 0, i64 ptrtoint (ptr getelementptr (i128, ptr null, i32 1) to i64)]] }
@_QMfactwithmodEkaijo = local_unnamed_addr global { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { ptr null, i64 ptrtoint (ptr getelementptr (i128, ptr null, i32 1) to i64), i32 20180515, i8 1, i8 11, i8 2, i8 0, [1 x [3 x i64]] [[3 x i64] [i64 1, i64 0, i64 ptrtoint (ptr getelementptr (i128, ptr null, i32 1) to i64)]] }
@_QQcl.370330f7e5817b30e19989e45572d084 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2359/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
define void @_QMfactwithmodPinitiationfactorial(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #1 {
  %3 = load i128, ptr %0, align 8, !tbaa !3
  %4 = trunc i128 %3 to i64
  %5 = add i64 %4, 1
  %6 = tail call i64 @llvm.smax.i64(i64 %5, i64 0)
  %7 = shl i64 %6, 4
  %8 = tail call ptr @malloc(i64 %7)
  %9 = icmp ugt i64 %4, 9223372036854775806
  %.neg = sext i1 %9 to i64
  %10 = zext i1 %9 to i64
  store ptr %8, ptr @_QMfactwithmodEkaijo, align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 3), align 4, !tbaa !7
  store i8 11, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 4), align 1, !tbaa !7
  store i8 2, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 6), align 1, !tbaa !7
  store i64 %10, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 7), align 8, !tbaa !7
  store i64 %6, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %11 = getelementptr i128, ptr %8, i64 %.neg
  store i128 1, ptr %11, align 8, !tbaa !3
  %12 = icmp sgt i64 %4, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %13 = load i128, ptr %1, align 8, !tbaa !3
  %14 = select i1 %9, i64 -16, i64 0
  %uglygep = getelementptr i8, ptr %8, i64 %14
  %load_initial = load i128, ptr %uglygep, align 8
  %xtraiter = and i64 %4, 1
  %15 = icmp eq i64 %4, 1
  br i1 %15, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %4, -2
  br label %16

16:                                               ; preds = %16, %.lr.ph.new
  %store_forwarded = phi i128 [ %load_initial, %.lr.ph.new ], [ %26, %16 ]
  %17 = phi i128 [ 1, %.lr.ph.new ], [ %29, %16 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %16 ]
  %18 = trunc i128 %17 to i64
  %19 = mul i128 %store_forwarded, %17
  %20 = srem i128 %19, %13
  %21 = sub i64 %18, %10
  %22 = getelementptr i128, ptr %8, i64 %21
  store i128 %20, ptr %22, align 8, !tbaa !3
  %23 = add nuw nsw i128 %17, 1
  %24 = trunc i128 %23 to i64
  %25 = mul i128 %20, %23
  %26 = srem i128 %25, %13
  %27 = sub i64 %24, %10
  %28 = getelementptr i128, ptr %8, i64 %27
  store i128 %26, ptr %28, align 8, !tbaa !3
  %29 = add nuw nsw i128 %17, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1.not, label %._crit_edge.loopexit.unr-lcssa, label %16

._crit_edge.loopexit.unr-lcssa:                   ; preds = %16, %.lr.ph
  %store_forwarded.unr = phi i128 [ %load_initial, %.lr.ph ], [ %26, %16 ]
  %.unr69 = phi i128 [ 1, %.lr.ph ], [ %29, %16 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %30 = trunc i128 %.unr69 to i64
  %31 = mul i128 %store_forwarded.unr, %.unr69
  %32 = srem i128 %31, %13
  %33 = sub i64 %30, %10
  %34 = getelementptr i128, ptr %8, i64 %33
  store i128 %32, ptr %34, align 8, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %2
  ret void
}

; Function Attrs: nofree nounwind
define void @_QMfactwithmodPcombination(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #1 {
  %4 = load i128, ptr %1, align 8, !tbaa !3
  %5 = trunc i128 %4 to i64
  %6 = tail call i64 @llvm.smax.i64(i64 %5, i64 0)
  %7 = shl i64 %6, 4
  %8 = tail call ptr @malloc(i64 %7)
  store ptr %8, ptr @_QMfactwithmodEcomb, align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 3), align 4, !tbaa !7
  store i8 11, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 4), align 1, !tbaa !7
  store i8 2, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 6), align 1, !tbaa !7
  store i64 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7), align 8, !tbaa !7
  store i64 %6, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %9 = load i128, ptr %0, align 8, !tbaa !3
  store i128 %9, ptr %8, align 8, !tbaa !3
  %10 = add i64 %5, -1
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %12 = load i128, ptr %2, align 8, !tbaa !3
  %13 = add i128 %12, -2
  br label %14

14:                                               ; preds = %.lr.ph, %_QMfactwithmodPinv.exit
  %15 = phi i64 [ %10, %.lr.ph ], [ %40, %_QMfactwithmodPinv.exit ]
  %16 = phi i128 [ 2, %.lr.ph ], [ %39, %_QMfactwithmodPinv.exit ]
  %17 = trunc i128 %16 to i64
  %18 = add i64 %17, -2
  %19 = getelementptr i128, ptr %8, i64 %18
  %20 = load i128, ptr %19, align 8, !tbaa !3
  %21 = sub nsw i128 1, %16
  %22 = add i128 %21, %9
  br label %23

23:                                               ; preds = %29, %14
  %.08.i = phi i128 [ 1, %14 ], [ %.1.i, %29 ]
  %.07.i = phi i128 [ %13, %14 ], [ %32, %29 ]
  %.0.i = phi i128 [ %16, %14 ], [ %31, %29 ]
  %24 = and i128 %.07.i, -170141183460469231731687303715884105727
  %25 = icmp eq i128 %24, 1
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = mul i128 %.0.i, %.08.i
  %28 = srem i128 %27, %12
  br label %29

29:                                               ; preds = %26, %23
  %.1.i = phi i128 [ %28, %26 ], [ %.08.i, %23 ]
  %30 = mul i128 %.0.i, %.0.i
  %31 = srem i128 %30, %12
  %32 = sdiv i128 %.07.i, 2
  %.07.off.i = add i128 %.07.i, 1
  %33 = icmp ult i128 %.07.off.i, 3
  br i1 %33, label %_QMfactwithmodPinv.exit, label %23

_QMfactwithmodPinv.exit:                          ; preds = %29
  %34 = mul i128 %22, %20
  %35 = mul i128 %34, %.1.i
  %36 = add i64 %17, -1
  %37 = getelementptr i128, ptr %8, i64 %36
  %38 = srem i128 %35, %12
  store i128 %38, ptr %37, align 8, !tbaa !3
  %39 = add nuw nsw i128 %16, 1
  %40 = add i64 %15, -1
  %41 = icmp sgt i64 %40, 0
  br i1 %41, label %14, label %._crit_edge

._crit_edge:                                      ; preds = %_QMfactwithmodPinv.exit, %3
  ret void
}

; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read)
define i128 @_QMfactwithmodPinv(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #2 {
  %3 = load i128, ptr %1, align 8, !tbaa !3
  %4 = add i128 %3, -2
  %5 = load i128, ptr %0, align 8, !tbaa !3
  br label %6

6:                                                ; preds = %12, %2
  %.08 = phi i128 [ 1, %2 ], [ %.1, %12 ]
  %.07 = phi i128 [ %4, %2 ], [ %15, %12 ]
  %.0 = phi i128 [ %5, %2 ], [ %14, %12 ]
  %7 = and i128 %.07, -170141183460469231731687303715884105727
  %8 = icmp eq i128 %7, 1
  br i1 %8, label %9, label %12

9:                                                ; preds = %6
  %10 = mul i128 %.0, %.08
  %11 = srem i128 %10, %3
  br label %12

12:                                               ; preds = %9, %6
  %.1 = phi i128 [ %11, %9 ], [ %.08, %6 ]
  %13 = mul i128 %.0, %.0
  %14 = srem i128 %13, %3
  %15 = sdiv i128 %.07, 2
  %.07.off = add i128 %.07, 1
  %16 = icmp ult i128 %.07.off, 3
  br i1 %16, label %17, label %6

17:                                               ; preds = %12
  ret i128 %.1
}

; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none)
define i128 @_QMfactwithmodPpermutation(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #3 {
  %.unpack = load ptr, ptr @_QMfactwithmodEkaijo, align 16, !tbaa !7
  %.unpack7.unpack.unpack = load i64, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEkaijo, i64 0, i32 7), align 8, !tbaa !7
  %4 = load i128, ptr %0, align 8, !tbaa !3
  %5 = trunc i128 %4 to i64
  %6 = sub i64 %5, %.unpack7.unpack.unpack
  %7 = getelementptr i128, ptr %.unpack, i64 %6
  %8 = load i128, ptr %7, align 8, !tbaa !3
  %9 = load i128, ptr %1, align 8, !tbaa !3
  %10 = sub i128 %4, %9
  %11 = trunc i128 %10 to i64
  %12 = sub i64 %11, %.unpack7.unpack.unpack
  %13 = getelementptr i128, ptr %.unpack, i64 %12
  %14 = load i128, ptr %2, align 8, !tbaa !3
  %15 = add i128 %14, -2
  %16 = load i128, ptr %13, align 8, !tbaa !3
  br label %17

17:                                               ; preds = %23, %3
  %.08.i = phi i128 [ 1, %3 ], [ %.1.i, %23 ]
  %.07.i = phi i128 [ %15, %3 ], [ %26, %23 ]
  %.0.i = phi i128 [ %16, %3 ], [ %25, %23 ]
  %18 = and i128 %.07.i, -170141183460469231731687303715884105727
  %19 = icmp eq i128 %18, 1
  br i1 %19, label %20, label %23

20:                                               ; preds = %17
  %21 = mul i128 %.0.i, %.08.i
  %22 = srem i128 %21, %14
  br label %23

23:                                               ; preds = %20, %17
  %.1.i = phi i128 [ %22, %20 ], [ %.08.i, %17 ]
  %24 = mul i128 %.0.i, %.0.i
  %25 = srem i128 %24, %14
  %26 = sdiv i128 %.07.i, 2
  %.07.off.i = add i128 %.07.i, 1
  %27 = icmp ult i128 %.07.off.i, 3
  br i1 %27, label %_QMfactwithmodPinv.exit, label %17

_QMfactwithmodPinv.exit:                          ; preds = %23
  %28 = mul i128 %.1.i, %8
  %29 = srem i128 %28, %14
  ret i128 %29
}

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i128, align 8
  %2 = alloca i128, align 8
  %3 = alloca i128, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.370330f7e5817b30e19989e45572d084, i32 60)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 16)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 16)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 16)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %9 = load i128, ptr %2, align 8, !tbaa !3
  %10 = trunc i128 %9 to i64
  %11 = call i64 @llvm.smax.i64(i64 %10, i64 0)
  %12 = shl i64 %11, 4
  %13 = call ptr @malloc(i64 %12)
  store ptr %13, ptr @_QMfactwithmodEcomb, align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 3), align 4, !tbaa !7
  store i8 11, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 4), align 1, !tbaa !7
  store i8 2, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 6), align 1, !tbaa !7
  store i64 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7), align 8, !tbaa !7
  store i64 %11, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 16, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QMfactwithmodEcomb, i64 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %14 = load i128, ptr %3, align 8, !tbaa !3
  store i128 %14, ptr %13, align 8, !tbaa !3
  %15 = add i64 %10, -1
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph.i, label %_QMfactwithmodPcombination.exit.preheader

.lr.ph.i:                                         ; preds = %0
  %17 = add i128 %14, 1
  br label %18

18:                                               ; preds = %_QMfactwithmodPinv.exit.i, %.lr.ph.i
  %19 = phi i64 [ %15, %.lr.ph.i ], [ %43, %_QMfactwithmodPinv.exit.i ]
  %20 = phi i128 [ 2, %.lr.ph.i ], [ %42, %_QMfactwithmodPinv.exit.i ]
  %21 = trunc i128 %20 to i64
  %22 = add i64 %21, -2
  %23 = getelementptr i128, ptr %13, i64 %22
  %24 = load i128, ptr %23, align 8, !tbaa !3
  br label %25

25:                                               ; preds = %31, %18
  %.08.i.i = phi i128 [ 1, %18 ], [ %.1.i.i, %31 ]
  %.07.i.i = phi i128 [ 1000000005, %18 ], [ %34, %31 ]
  %.0.i.i = phi i128 [ %20, %18 ], [ %33, %31 ]
  %26 = and i128 %.07.i.i, -170141183460469231731687303715884105727
  %27 = icmp eq i128 %26, 1
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = mul i128 %.0.i.i, %.08.i.i
  %30 = srem i128 %29, 1000000007
  br label %31

31:                                               ; preds = %28, %25
  %.1.i.i = phi i128 [ %30, %28 ], [ %.08.i.i, %25 ]
  %32 = mul i128 %.0.i.i, %.0.i.i
  %33 = srem i128 %32, 1000000007
  %34 = sdiv i128 %.07.i.i, 2
  %.07.off.i.i = add nsw i128 %.07.i.i, 1
  %35 = icmp ult i128 %.07.off.i.i, 3
  br i1 %35, label %_QMfactwithmodPinv.exit.i, label %25

_QMfactwithmodPinv.exit.i:                        ; preds = %31
  %36 = sub i128 %17, %20
  %37 = mul i128 %36, %24
  %38 = mul i128 %37, %.1.i.i
  %39 = add i64 %21, -1
  %40 = getelementptr i128, ptr %13, i64 %39
  %41 = srem i128 %38, 1000000007
  store i128 %41, ptr %40, align 8, !tbaa !3
  %42 = add nuw nsw i128 %20, 1
  %43 = add i64 %19, -1
  %44 = icmp sgt i64 %43, 0
  br i1 %44, label %18, label %_QMfactwithmodPcombination.exit.preheader

_QMfactwithmodPcombination.exit.preheader:        ; preds = %_QMfactwithmodPinv.exit.i, %0
  br label %_QMfactwithmodPcombination.exit

_QMfactwithmodPcombination.exit:                  ; preds = %_QMfactwithmodPcombination.exit.preheader, %50
  %.08.i = phi i128 [ %53, %50 ], [ %14, %_QMfactwithmodPcombination.exit.preheader ]
  %.07.i = phi i128 [ %.1.i, %50 ], [ 1, %_QMfactwithmodPcombination.exit.preheader ]
  %.0.i = phi i128 [ %52, %50 ], [ 2, %_QMfactwithmodPcombination.exit.preheader ]
  %45 = and i128 %.08.i, -170141183460469231731687303715884105727
  %46 = icmp eq i128 %45, 1
  br i1 %46, label %47, label %50

47:                                               ; preds = %_QMfactwithmodPcombination.exit
  %48 = mul i128 %.0.i, %.07.i
  %49 = srem i128 %48, 1000000007
  br label %50

50:                                               ; preds = %47, %_QMfactwithmodPcombination.exit
  %.1.i = phi i128 [ %49, %47 ], [ %.07.i, %_QMfactwithmodPcombination.exit ]
  %51 = mul nuw nsw i128 %.0.i, %.0.i
  %52 = urem i128 %51, 1000000007
  %53 = sdiv i128 %.08.i, 2
  %.08.off.i = add i128 %.08.i, 1
  %54 = icmp ult i128 %.08.off.i, 3
  br i1 %54, label %_QFPpower_func.exit, label %_QMfactwithmodPcombination.exit

_QFPpower_func.exit:                              ; preds = %50
  %55 = load i128, ptr %1, align 8, !tbaa !3
  %56 = trunc i128 %55 to i64
  %57 = add i64 %56, -1
  %58 = getelementptr i128, ptr %13, i64 %57
  %59 = load i128, ptr %58, align 8, !tbaa !3
  %60 = xor i128 %59, -1
  %61 = add i128 %.1.i, %60
  %62 = getelementptr i128, ptr %13, i64 %15
  %63 = load i128, ptr %62, align 8, !tbaa !3
  %64 = sub i128 %61, %63
  %65 = srem i128 %64, 1000000007
  %66 = icmp slt i128 %65, 0
  %67 = select i1 %66, i128 1000000007, i128 0
  %spec.select = add nsw i128 %67, %65
  %68 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.370330f7e5817b30e19989e45572d084, i32 66)
  %69 = call i1 @_FortranAioOutputInteger128(ptr %68, i128 %spec.select)
  %70 = call i32 @_FortranAioEndIoStatement(ptr %68)
  ret void
}

; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read)
define i128 @_QFPpower_func(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #2 {
  %4 = load i128, ptr %1, align 8, !tbaa !3
  %5 = load i128, ptr %0, align 8, !tbaa !3
  %6 = load i128, ptr %2, align 8, !tbaa !3
  br label %7

7:                                                ; preds = %13, %3
  %.08 = phi i128 [ %4, %3 ], [ %16, %13 ]
  %.07 = phi i128 [ 1, %3 ], [ %.1, %13 ]
  %.0 = phi i128 [ %5, %3 ], [ %15, %13 ]
  %8 = and i128 %.08, -170141183460469231731687303715884105727
  %9 = icmp eq i128 %8, 1
  br i1 %9, label %10, label %13

10:                                               ; preds = %7
  %11 = mul i128 %.0, %.07
  %12 = srem i128 %11, %6
  br label %13

13:                                               ; preds = %10, %7
  %.1 = phi i128 [ %12, %10 ], [ %.07, %7 ]
  %14 = mul i128 %.0, %.0
  %15 = srem i128 %14, %6
  %16 = sdiv i128 %.08, 2
  %.08.off = add i128 %.08, 1
  %17 = icmp ult i128 %.08.off, 3
  br i1 %17, label %18, label %7

18:                                               ; preds = %13
  ret i128 %.1
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger128(ptr, i128) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nofree nounwind }
attributes #2 = { nofree norecurse nosync nounwind memory(argmem: read) }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
