      MODULE intQsortMod
! 整数型のクイックソート
! precisionで整数の精度を定める．
! インデックスの小さいほうが値も小さい(昇順)．

! 参考
! https://t.doujin-constant.net/post/143374686394/fortranをより使いこなしたquick-sort

      implicit none
      integer,parameter,private :: precision = 4
      
      interface qSort
        module procedure :: intQsort
      end interface
      
      contains
      pure recursive function intQsort( a ) result( r )
        implicit none
        integer(precision), intent(in) :: a(:)
        integer(precision) :: r( size(a) )
        integer(precision) :: sample(3), len, i,j
        
        len = size( a(:) )
        if( len<=1 )then
          r = a
        else
          !select pivot
          sample(1:3) = [a(1), a(len/2), a(len)]
          do i = 1,2
            do j = 2,3
              if( sample(i)>sample(j) )then
                len = sample(i) !len is buffer
                sample(i) = sample(j)
                sample(j) = len
              end if
            end do
          end do
          
          r = [ qSort( pack(a(:), a(:)< sample(2) ) ), &
                       pack(a(:), a(:)==sample(2) )  , &
                qSort( pack(a(:), a(:)> sample(2) ) ) ]
        end if
      end function intQsort
      END MODULE intQsortMod


      module piyoMod
      implicit none
      integer :: n,numA=0
      integer :: mkdArray(5*10**5)=0
      
      
      contains
      !cnt 新しく作る桁
      recursive subroutine mkA( cnt,array,flag )
        implicit none
        integer,intent(in) :: cnt,array(:)
        integer :: a(size(array))
        logical,intent(in) :: flag(:)
        logical :: f(size(flag))
        integer :: i
        
        if( cnt>n )then
          numA = numA + 1
          do i = 1,n
            mkdArray(numA) = mkdArray(numA) + array(i)*10**(i-1)
          end do
          return
        else
          a = array(:)
          f = flag(:)
          do i = 1,n
            if( flag(i) ) cycle
            a(cnt) = i
            f(i) = .true.
            call mkA( cnt+1,a,f )
            f(i) = .false.
          end do
        end if
      end subroutine
      
      end module
      
      PROGRAM countOrder
      use piyoMod
      use intQsortMod
      IMPLICIT NONE
      integer :: valP=0,valQ=0,indP,indQ,i
      integer,allocatable :: p(:),q(:),dummy(:)
      logical,allocatable :: flag(:)
      
      read*,n
      allocate( p(n),q(n),dummy(n), flag(n) )
      read*,p(n:1:-1)
      read*,q(n:1:-1)
      
      
      
      flag = .false.
      call mkA( 1,dummy,flag )
      
      mkdArray(1:numA) = qsort( mkdArray(1:numA) )
      
      
      
      do i = 1,n
        valP = valP + p(i)*10**(i-1)
        valQ = valQ + q(i)*10**(i-1)
      end do
      
      do i = 1,numA
        if( mkdArray(i)==valP )then
          indP = i
        end if
        if( mkdArray(i)==valQ )then
          indQ = i
        end if
      end do
      
      print*,abs(indP - indQ)
      
      
!      print*,mkdArray(1:numA)
      
      
      
      END PROGRAM
; 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"

@_QMintqsortmodECprecision = local_unnamed_addr constant i32 4
@_QMpiyomodEmkdarray = global [500000 x i32] zeroinitializer
@_QMpiyomodEn = global i32 undef
@_QMpiyomodEnuma = local_unnamed_addr global i32 0
@_QQcl.8b239cae78ec892f49a01df4d229da38 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2694/source.f\00"
@_QFEdummy.0 = internal unnamed_addr global ptr null
@_QFEdummy.8 = internal unnamed_addr global i64 0
@_QFEflag.0 = internal unnamed_addr global ptr null
@_QFEflag.7 = internal unnamed_addr global i64 1
@_QFEflag.8 = internal unnamed_addr global i64 0
@_QFEp.0 = internal unnamed_addr global ptr null
@_QFEq.0 = internal unnamed_addr global ptr null
@_QFEvalp = internal unnamed_addr global i32 0
@_QFEvalq = internal unnamed_addr global i32 0
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

define void @_QMintqsortmodPintqsort(ptr nocapture writeonly %0, ptr nocapture readonly %1) local_unnamed_addr {
  %3 = ptrtoint ptr %0 to i64
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %7 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %8 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %9 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %10 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %11 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %12 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %13 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %14 = load i64, ptr %13, align 8, !tbaa !3
  %15 = tail call i64 @llvm.smax.i64(i64 %14, i64 0)
  %16 = trunc i64 %15 to i32
  %17 = icmp slt i32 %16, 2
  br i1 %17, label %.preheader, label %.preheader418

.preheader:                                       ; preds = %2
  %.not444 = icmp slt i64 %14, 1
  br i1 %.not444, label %.loopexit, label %.lr.ph437

.lr.ph437:                                        ; preds = %.preheader
  %18 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %19 = load i64, ptr %18, align 8, !tbaa !3
  %20 = load ptr, ptr %1, align 8, !tbaa !3
  %21 = add nsw i64 %15, -1
  %xtraiter476 = and i64 %15, 3
  %22 = icmp ult i64 %21, 3
  br i1 %22, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph437.new

.lr.ph437.new:                                    ; preds = %.lr.ph437
  %unroll_iter479 = and i64 %15, 9223372036854775804
  br label %23

23:                                               ; preds = %23, %.lr.ph437.new
  %24 = phi i64 [ 0, %.lr.ph437.new ], [ %40, %23 ]
  %niter480 = phi i64 [ 0, %.lr.ph437.new ], [ %niter480.next.3, %23 ]
  %25 = or i64 %24, 1
  %26 = mul i64 %19, %24
  %27 = getelementptr i8, ptr %20, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !7
  %29 = getelementptr i32, ptr %0, i64 %24
  store i32 %28, ptr %29, align 4, !tbaa !7
  %30 = or i64 %24, 2
  %31 = mul i64 %19, %25
  %32 = getelementptr i8, ptr %20, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !7
  %34 = getelementptr i32, ptr %0, i64 %25
  store i32 %33, ptr %34, align 4, !tbaa !7
  %35 = or i64 %24, 3
  %36 = mul i64 %19, %30
  %37 = getelementptr i8, ptr %20, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !7
  %39 = getelementptr i32, ptr %0, i64 %30
  store i32 %38, ptr %39, align 4, !tbaa !7
  %40 = add nuw nsw i64 %24, 4
  %41 = mul i64 %19, %35
  %42 = getelementptr i8, ptr %20, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !7
  %44 = getelementptr i32, ptr %0, i64 %35
  store i32 %43, ptr %44, align 4, !tbaa !7
  %niter480.next.3 = add i64 %niter480, 4
  %niter480.ncmp.3 = icmp eq i64 %niter480.next.3, %unroll_iter479
  br i1 %niter480.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %23

.preheader418:                                    ; preds = %2
  %45 = tail call dereferenceable_or_null(12) ptr @malloc(i64 12)
  %46 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %47 = load ptr, ptr %1, align 8, !tbaa !3
  %48 = load i32, ptr %47, align 4, !tbaa !7
  store i32 %48, ptr %45, align 4, !tbaa !7
  %49 = lshr i64 %15, 1
  %50 = and i64 %49, 2147483647
  %51 = add nsw i64 %50, -1
  %52 = load i64, ptr %46, align 8, !tbaa !3
  %53 = mul i64 %52, %51
  %54 = getelementptr i8, ptr %47, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !7
  %56 = getelementptr [3 x i32], ptr %45, i64 0, i64 1
  store i32 %55, ptr %56, align 4, !tbaa !7
  %57 = and i64 %15, 4294967295
  %58 = add nsw i64 %57, -1
  %59 = mul i64 %52, %58
  %60 = getelementptr i8, ptr %47, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !7
  %62 = tail call dereferenceable_or_null(24) ptr @realloc(ptr nonnull %45, i64 24)
  %.sroa.0.0.copyload = load i32, ptr %62, align 4, !tbaa !7
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %62, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !7
  tail call void @free(ptr nonnull %62)
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.sroa.0.0.copyload, i32 %.sroa.5.0.copyload)
  %spec.select458 = tail call i32 @llvm.smin.i32(i32 %.sroa.0.0.copyload, i32 %.sroa.5.0.copyload)
  %.sroa.15.0 = tail call i32 @llvm.smax.i32(i32 %spec.select458, i32 %61)
  %.sroa.5.2 = tail call i32 @llvm.smin.i32(i32 %spec.select, i32 %.sroa.15.0)
  %63 = tail call dereferenceable_or_null(128) ptr @malloc(i64 128)
  store ptr %47, ptr %9, align 8, !tbaa !3
  %.fca.1.gep139 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep139, align 8, !tbaa !3
  %.fca.2.gep141 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep141, align 8, !tbaa !3
  %.fca.3.gep143 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep143, align 4, !tbaa !3
  %.fca.4.gep145 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep145, align 1, !tbaa !3
  %.fca.5.gep147 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep147, align 2, !tbaa !3
  %.fca.6.gep149 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep149, align 1, !tbaa !3
  %.fca.7.0.0.gep151 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep151, align 8, !tbaa !3
  %.fca.7.0.1.gep153 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 7, i64 0, i64 1
  store i64 %15, ptr %.fca.7.0.1.gep153, align 8, !tbaa !3
  %.fca.7.0.2.gep155 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %9, i64 0, i32 7, i64 0, i64 2
  store i64 %52, ptr %.fca.7.0.2.gep155, align 8, !tbaa !3
  %64 = shl i64 %15, 2
  %65 = tail call ptr @malloc(i64 %64)
  %.not438 = icmp slt i64 %14, 1
  br i1 %.not438, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader418
  %xtraiter = and i64 %15, 1
  %66 = icmp eq i64 %15, 1
  br i1 %66, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %15, 9223372036854775806
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %67 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %75, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %68 = or i64 %67, 1
  %69 = mul i64 %67, %52
  %70 = getelementptr i8, ptr %47, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !7
  %72 = icmp slt i32 %71, %.sroa.5.2
  %73 = zext i1 %72 to i32
  %74 = getelementptr i32, ptr %65, i64 %67
  store i32 %73, ptr %74, align 4, !tbaa !7
  %75 = add nuw nsw i64 %67, 2
  %76 = mul i64 %68, %52
  %77 = getelementptr i8, ptr %47, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !7
  %79 = icmp slt i32 %78, %.sroa.5.2
  %80 = zext i1 %79 to i32
  %81 = getelementptr i32, ptr %65, i64 %68
  store i32 %80, ptr %81, align 4, !tbaa !7
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %75, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %82 = mul i64 %.unr, %52
  %83 = getelementptr i8, ptr %47, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !7
  %85 = icmp slt i32 %84, %.sroa.5.2
  %86 = zext i1 %85 to i32
  %87 = getelementptr i32, ptr %65, i64 %.unr
  store i32 %86, ptr %87, align 4, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader418
  store ptr %65, ptr %8, align 8, !tbaa !3
  %.fca.1.gep159 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep159, align 8, !tbaa !3
  %.fca.2.gep161 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep161, align 8, !tbaa !3
  %.fca.3.gep163 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep163, align 4, !tbaa !3
  %.fca.4.gep165 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 4
  store i8 14, ptr %.fca.4.gep165, align 1, !tbaa !3
  %.fca.5.gep167 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep167, align 2, !tbaa !3
  %.fca.6.gep169 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep169, align 1, !tbaa !3
  %.fca.7.0.0.gep171 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep171, align 8, !tbaa !3
  %.fca.7.0.1.gep173 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 7, i64 0, i64 1
  store i64 %15, ptr %.fca.7.0.1.gep173, align 8, !tbaa !3
  %.fca.7.0.2.gep175 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %8, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep175, align 8, !tbaa !3
  store ptr null, ptr %12, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 7, i64 0, i64 1
  store i64 0, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %12, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %88 = call {} @_FortranAPack(ptr nonnull %12, ptr nonnull %9, ptr nonnull %8, ptr null, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 39)
  %.fca.0.load = load ptr, ptr %12, align 8, !tbaa !3
  %.fca.7.0.0.load = load i64, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.load = load i64, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %89 = icmp eq i64 %.fca.7.0.1.load, 0
  %90 = select i1 %89, i64 1, i64 %.fca.7.0.0.load
  store ptr %.fca.0.load, ptr %7, align 8, !tbaa !3
  %.fca.1.gep301 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep301, align 8, !tbaa !3
  %.fca.2.gep303 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep303, align 8, !tbaa !3
  %.fca.3.gep305 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep305, align 4, !tbaa !3
  %.fca.4.gep307 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep307, align 1, !tbaa !3
  %.fca.5.gep309 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep309, align 2, !tbaa !3
  %.fca.6.gep311 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep311, align 1, !tbaa !3
  %.fca.7.0.0.gep313 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 7, i64 0, i64 0
  store i64 %90, ptr %.fca.7.0.0.gep313, align 8, !tbaa !3
  %.fca.7.0.1.gep315 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 7, i64 0, i64 1
  store i64 %.fca.7.0.1.load, ptr %.fca.7.0.1.gep315, align 8, !tbaa !3
  %.fca.7.0.2.gep317 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %7, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep317, align 8, !tbaa !3
  %91 = call i64 @llvm.smax.i64(i64 %.fca.7.0.1.load, i64 0)
  %92 = call ptr @llvm.stacksave()
  %93 = alloca i32, i64 %91, align 4
  call void @_QMintqsortmodPintqsort(ptr nonnull %93, ptr nonnull %7)
  %94 = shl i64 %91, 2
  %95 = call ptr @malloc(i64 %94)
  %.not439 = icmp slt i64 %.fca.7.0.1.load, 1
  br i1 %.not439, label %._crit_edge421, label %.lr.ph420.preheader

.lr.ph420.preheader:                              ; preds = %._crit_edge
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %95, ptr nonnull align 4 %93, i64 %94, i1 false), !tbaa !7
  br label %._crit_edge421

._crit_edge421:                                   ; preds = %.lr.ph420.preheader, %._crit_edge
  %96 = icmp ugt i64 %91, 31
  br i1 %96, label %97, label %101

97:                                               ; preds = %._crit_edge421
  %98 = shl nuw i64 %91, 1
  %99 = shl i64 %91, 3
  %100 = call ptr @realloc(ptr %63, i64 %99)
  br label %101

101:                                              ; preds = %97, %._crit_edge421
  %.0398 = phi i64 [ %98, %97 ], [ 32, %._crit_edge421 ]
  %102 = phi ptr [ %100, %97 ], [ %63, %._crit_edge421 ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %102, ptr align 1 %95, i64 %94, i1 false)
  %103 = call ptr @malloc(i64 %64)
  br i1 %.not438, label %._crit_edge424, label %.lr.ph423

.lr.ph423:                                        ; preds = %101
  %104 = load i64, ptr %46, align 8, !tbaa !3
  %105 = load ptr, ptr %1, align 8, !tbaa !3
  %xtraiter461 = and i64 %15, 1
  %106 = icmp eq i64 %15, 1
  br i1 %106, label %._crit_edge424.loopexit.unr-lcssa, label %.lr.ph423.new

.lr.ph423.new:                                    ; preds = %.lr.ph423
  %unroll_iter464 = and i64 %15, 9223372036854775806
  br label %107

107:                                              ; preds = %107, %.lr.ph423.new
  %108 = phi i64 [ 0, %.lr.ph423.new ], [ %116, %107 ]
  %niter465 = phi i64 [ 0, %.lr.ph423.new ], [ %niter465.next.1, %107 ]
  %109 = or i64 %108, 1
  %110 = mul i64 %104, %108
  %111 = getelementptr i8, ptr %105, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !7
  %113 = icmp eq i32 %112, %.sroa.5.2
  %114 = zext i1 %113 to i32
  %115 = getelementptr i32, ptr %103, i64 %108
  store i32 %114, ptr %115, align 4, !tbaa !7
  %116 = add nuw nsw i64 %108, 2
  %117 = mul i64 %104, %109
  %118 = getelementptr i8, ptr %105, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !7
  %120 = icmp eq i32 %119, %.sroa.5.2
  %121 = zext i1 %120 to i32
  %122 = getelementptr i32, ptr %103, i64 %109
  store i32 %121, ptr %122, align 4, !tbaa !7
  %niter465.next.1 = add i64 %niter465, 2
  %niter465.ncmp.1 = icmp eq i64 %niter465.next.1, %unroll_iter464
  br i1 %niter465.ncmp.1, label %._crit_edge424.loopexit.unr-lcssa, label %107

._crit_edge424.loopexit.unr-lcssa:                ; preds = %107, %.lr.ph423
  %.unr462 = phi i64 [ 0, %.lr.ph423 ], [ %116, %107 ]
  %lcmp.mod463.not = icmp eq i64 %xtraiter461, 0
  br i1 %lcmp.mod463.not, label %._crit_edge424, label %._crit_edge424.loopexit.epilog-lcssa

._crit_edge424.loopexit.epilog-lcssa:             ; preds = %._crit_edge424.loopexit.unr-lcssa
  %123 = mul i64 %104, %.unr462
  %124 = getelementptr i8, ptr %105, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !7
  %126 = icmp eq i32 %125, %.sroa.5.2
  %127 = zext i1 %126 to i32
  %128 = getelementptr i32, ptr %103, i64 %.unr462
  store i32 %127, ptr %128, align 4, !tbaa !7
  br label %._crit_edge424

._crit_edge424:                                   ; preds = %._crit_edge424.loopexit.epilog-lcssa, %._crit_edge424.loopexit.unr-lcssa, %101
  store ptr %103, ptr %6, align 8, !tbaa !3
  %.fca.1.gep321 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep321, align 8, !tbaa !3
  %.fca.2.gep323 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep323, align 8, !tbaa !3
  %.fca.3.gep325 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep325, align 4, !tbaa !3
  %.fca.4.gep327 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 4
  store i8 14, ptr %.fca.4.gep327, align 1, !tbaa !3
  %.fca.5.gep329 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep329, align 2, !tbaa !3
  %.fca.6.gep331 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep331, align 1, !tbaa !3
  %.fca.7.0.0.gep333 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep333, align 8, !tbaa !3
  %.fca.7.0.1.gep335 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 1
  store i64 %15, ptr %.fca.7.0.1.gep335, align 8, !tbaa !3
  %.fca.7.0.2.gep337 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep337, align 8, !tbaa !3
  store ptr null, ptr %11, align 8, !tbaa !3
  %.fca.1.gep39 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep39, align 8, !tbaa !3
  %.fca.2.gep41 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep41, align 8, !tbaa !3
  %.fca.3.gep43 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep43, align 4, !tbaa !3
  %.fca.4.gep45 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep45, align 1, !tbaa !3
  %.fca.5.gep47 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep47, align 2, !tbaa !3
  %.fca.6.gep49 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep49, align 1, !tbaa !3
  %.fca.7.0.0.gep51 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep51, align 8, !tbaa !3
  %.fca.7.0.1.gep53 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 7, i64 0, i64 1
  store i64 0, ptr %.fca.7.0.1.gep53, align 8, !tbaa !3
  %.fca.7.0.2.gep55 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %11, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep55, align 8, !tbaa !3
  %129 = call {} @_FortranAPack(ptr nonnull %11, ptr nonnull %9, ptr nonnull %6, ptr null, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 39)
  %.fca.0.load57 = load ptr, ptr %11, align 8, !tbaa !3
  %.fca.7.0.1.load81 = load i64, ptr %.fca.7.0.1.gep53, align 8, !tbaa !3
  %130 = shl i64 %.fca.7.0.1.load81, 2
  %131 = call ptr @malloc(i64 %130)
  %132 = icmp sgt i64 %.fca.7.0.1.load81, 0
  br i1 %132, label %.lr.ph426.preheader, label %._crit_edge427

.lr.ph426.preheader:                              ; preds = %._crit_edge424
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %131, ptr align 4 %.fca.0.load57, i64 %130, i1 false), !tbaa !7
  br label %._crit_edge427

._crit_edge427:                                   ; preds = %.lr.ph426.preheader, %._crit_edge424
  %133 = add i64 %.fca.7.0.1.load81, %91
  %.not = icmp sgt i64 %.0398, %133
  br i1 %.not, label %138, label %134

134:                                              ; preds = %._crit_edge427
  %135 = shl i64 %133, 1
  %136 = shl i64 %133, 3
  %137 = call ptr @realloc(ptr %102, i64 %136)
  br label %138

138:                                              ; preds = %134, %._crit_edge427
  %.1399 = phi i64 [ %135, %134 ], [ %.0398, %._crit_edge427 ]
  %139 = phi ptr [ %137, %134 ], [ %102, %._crit_edge427 ]
  %140 = getelementptr i32, ptr %139, i64 %91
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %140, ptr align 1 %131, i64 %130, i1 false)
  %141 = call ptr @malloc(i64 %64)
  br i1 %.not438, label %._crit_edge430, label %.lr.ph429

.lr.ph429:                                        ; preds = %138
  %142 = load i64, ptr %46, align 8, !tbaa !3
  %143 = load ptr, ptr %1, align 8, !tbaa !3
  %xtraiter467 = and i64 %15, 1
  %144 = icmp eq i64 %15, 1
  br i1 %144, label %._crit_edge430.loopexit.unr-lcssa, label %.lr.ph429.new

.lr.ph429.new:                                    ; preds = %.lr.ph429
  %unroll_iter470 = and i64 %15, 9223372036854775806
  br label %145

145:                                              ; preds = %145, %.lr.ph429.new
  %146 = phi i64 [ 0, %.lr.ph429.new ], [ %154, %145 ]
  %niter471 = phi i64 [ 0, %.lr.ph429.new ], [ %niter471.next.1, %145 ]
  %147 = or i64 %146, 1
  %148 = mul i64 %142, %146
  %149 = getelementptr i8, ptr %143, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !7
  %151 = icmp sgt i32 %150, %.sroa.5.2
  %152 = zext i1 %151 to i32
  %153 = getelementptr i32, ptr %141, i64 %146
  store i32 %152, ptr %153, align 4, !tbaa !7
  %154 = add nuw nsw i64 %146, 2
  %155 = mul i64 %142, %147
  %156 = getelementptr i8, ptr %143, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !7
  %158 = icmp sgt i32 %157, %.sroa.5.2
  %159 = zext i1 %158 to i32
  %160 = getelementptr i32, ptr %141, i64 %147
  store i32 %159, ptr %160, align 4, !tbaa !7
  %niter471.next.1 = add i64 %niter471, 2
  %niter471.ncmp.1 = icmp eq i64 %niter471.next.1, %unroll_iter470
  br i1 %niter471.ncmp.1, label %._crit_edge430.loopexit.unr-lcssa, label %145

._crit_edge430.loopexit.unr-lcssa:                ; preds = %145, %.lr.ph429
  %.unr468 = phi i64 [ 0, %.lr.ph429 ], [ %154, %145 ]
  %lcmp.mod469.not = icmp eq i64 %xtraiter467, 0
  br i1 %lcmp.mod469.not, label %._crit_edge430, label %._crit_edge430.loopexit.epilog-lcssa

._crit_edge430.loopexit.epilog-lcssa:             ; preds = %._crit_edge430.loopexit.unr-lcssa
  %161 = mul i64 %142, %.unr468
  %162 = getelementptr i8, ptr %143, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !7
  %164 = icmp sgt i32 %163, %.sroa.5.2
  %165 = zext i1 %164 to i32
  %166 = getelementptr i32, ptr %141, i64 %.unr468
  store i32 %165, ptr %166, align 4, !tbaa !7
  br label %._crit_edge430

._crit_edge430:                                   ; preds = %._crit_edge430.loopexit.epilog-lcssa, %._crit_edge430.loopexit.unr-lcssa, %138
  store ptr %141, ptr %5, align 8, !tbaa !3
  %.fca.1.gep351 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep351, align 8, !tbaa !3
  %.fca.2.gep353 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep353, align 8, !tbaa !3
  %.fca.3.gep355 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep355, align 4, !tbaa !3
  %.fca.4.gep357 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 4
  store i8 14, ptr %.fca.4.gep357, align 1, !tbaa !3
  %.fca.5.gep359 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep359, align 2, !tbaa !3
  %.fca.6.gep361 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep361, align 1, !tbaa !3
  %.fca.7.0.0.gep363 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep363, align 8, !tbaa !3
  %.fca.7.0.1.gep365 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 1
  store i64 %15, ptr %.fca.7.0.1.gep365, align 8, !tbaa !3
  %.fca.7.0.2.gep367 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep367, align 8, !tbaa !3
  store ptr null, ptr %10, align 8, !tbaa !3
  %.fca.1.gep89 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep89, align 8, !tbaa !3
  %.fca.2.gep91 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep91, align 8, !tbaa !3
  %.fca.3.gep93 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep93, align 4, !tbaa !3
  %.fca.4.gep95 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep95, align 1, !tbaa !3
  %.fca.5.gep97 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep97, align 2, !tbaa !3
  %.fca.6.gep99 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep99, align 1, !tbaa !3
  %.fca.7.0.0.gep101 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep101, align 8, !tbaa !3
  %.fca.7.0.1.gep103 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 7, i64 0, i64 1
  store i64 0, ptr %.fca.7.0.1.gep103, align 8, !tbaa !3
  %.fca.7.0.2.gep105 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %10, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep105, align 8, !tbaa !3
  %167 = call {} @_FortranAPack(ptr nonnull %10, ptr nonnull %9, ptr nonnull %5, ptr null, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 39)
  %.fca.0.load107 = load ptr, ptr %10, align 8, !tbaa !3
  %.fca.7.0.0.load128 = load i64, ptr %.fca.7.0.0.gep101, align 8, !tbaa !3
  %.fca.7.0.1.load131 = load i64, ptr %.fca.7.0.1.gep103, align 8, !tbaa !3
  %168 = icmp eq i64 %.fca.7.0.1.load131, 0
  %169 = select i1 %168, i64 1, i64 %.fca.7.0.0.load128
  store ptr %.fca.0.load107, ptr %4, align 8, !tbaa !3
  %.fca.1.gep381 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep381, align 8, !tbaa !3
  %.fca.2.gep383 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep383, align 8, !tbaa !3
  %.fca.3.gep385 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep385, align 4, !tbaa !3
  %.fca.4.gep387 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep387, align 1, !tbaa !3
  %.fca.5.gep389 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep389, align 2, !tbaa !3
  %.fca.6.gep391 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep391, align 1, !tbaa !3
  %.fca.7.0.0.gep393 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 0
  store i64 %169, ptr %.fca.7.0.0.gep393, align 8, !tbaa !3
  %.fca.7.0.1.gep395 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 1
  store i64 %.fca.7.0.1.load131, ptr %.fca.7.0.1.gep395, align 8, !tbaa !3
  %.fca.7.0.2.gep397 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep397, align 8, !tbaa !3
  %170 = call i64 @llvm.smax.i64(i64 %.fca.7.0.1.load131, i64 0)
  %171 = call ptr @llvm.stacksave()
  %172 = alloca i32, i64 %170, align 4
  call void @_QMintqsortmodPintqsort(ptr nonnull %172, ptr nonnull %4)
  %173 = shl i64 %170, 2
  %174 = call ptr @malloc(i64 %173)
  %.not442 = icmp slt i64 %.fca.7.0.1.load131, 1
  br i1 %.not442, label %._crit_edge433, label %.lr.ph432.preheader

.lr.ph432.preheader:                              ; preds = %._crit_edge430
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %174, ptr nonnull align 4 %172, i64 %173, i1 false), !tbaa !7
  br label %._crit_edge433

._crit_edge433:                                   ; preds = %.lr.ph432.preheader, %._crit_edge430
  %175 = add i64 %170, %133
  %.not417 = icmp sgt i64 %.1399, %175
  br i1 %.not417, label %179, label %176

176:                                              ; preds = %._crit_edge433
  %177 = shl i64 %175, 3
  %178 = call ptr @realloc(ptr %139, i64 %177)
  br label %179

179:                                              ; preds = %176, %._crit_edge433
  %180 = phi ptr [ %178, %176 ], [ %139, %._crit_edge433 ]
  %181 = getelementptr i32, ptr %180, i64 %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %181, ptr align 1 %174, i64 %173, i1 false)
  br i1 %.not438, label %._crit_edge436, label %.lr.ph435.preheader

.lr.ph435.preheader:                              ; preds = %179
  %182 = ptrtoint ptr %180 to i64
  %min.iters.check = icmp ult i64 %15, 8
  %183 = sub i64 %3, %182
  %diff.check = icmp ult i64 %183, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %.lr.ph435.preheader460, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph435.preheader
  %n.vec = and i64 %15, 9223372036854775800
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %184 = getelementptr i32, ptr %180, i64 %index
  %wide.load = load <4 x i32>, ptr %184, align 4, !tbaa !7
  %185 = getelementptr i32, ptr %184, i64 4
  %wide.load459 = load <4 x i32>, ptr %185, align 4, !tbaa !7
  %186 = getelementptr i32, ptr %0, i64 %index
  store <4 x i32> %wide.load, ptr %186, align 4, !tbaa !7
  %187 = getelementptr i32, ptr %186, i64 4
  store <4 x i32> %wide.load459, ptr %187, align 4, !tbaa !7
  %index.next = add nuw i64 %index, 8
  %188 = icmp eq i64 %index.next, %n.vec
  br i1 %188, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %15, %n.vec
  br i1 %cmp.n, label %._crit_edge436, label %.lr.ph435.preheader460

.lr.ph435.preheader460:                           ; preds = %.lr.ph435.preheader, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph435.preheader ], [ %n.vec, %middle.block ]
  %189 = xor i64 %.ph, -1
  %190 = add nsw i64 %15, %189
  %xtraiter472 = and i64 %15, 3
  %lcmp.mod473.not = icmp eq i64 %xtraiter472, 0
  br i1 %lcmp.mod473.not, label %.lr.ph435.prol.loopexit, label %.lr.ph435.prol

.lr.ph435.prol:                                   ; preds = %.lr.ph435.preheader460, %.lr.ph435.prol
  %191 = phi i64 [ %192, %.lr.ph435.prol ], [ %.ph, %.lr.ph435.preheader460 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph435.prol ], [ 0, %.lr.ph435.preheader460 ]
  %192 = add nuw nsw i64 %191, 1
  %193 = getelementptr i32, ptr %180, i64 %191
  %194 = load i32, ptr %193, align 4, !tbaa !7
  %195 = getelementptr i32, ptr %0, i64 %191
  store i32 %194, ptr %195, align 4, !tbaa !7
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter472
  br i1 %prol.iter.cmp.not, label %.lr.ph435.prol.loopexit, label %.lr.ph435.prol, !llvm.loop !12

.lr.ph435.prol.loopexit:                          ; preds = %.lr.ph435.prol, %.lr.ph435.preheader460
  %.unr474 = phi i64 [ %.ph, %.lr.ph435.preheader460 ], [ %192, %.lr.ph435.prol ]
  %196 = icmp ult i64 %190, 3
  br i1 %196, label %._crit_edge436, label %.lr.ph435

.lr.ph435:                                        ; preds = %.lr.ph435.prol.loopexit, %.lr.ph435
  %197 = phi i64 [ %210, %.lr.ph435 ], [ %.unr474, %.lr.ph435.prol.loopexit ]
  %198 = add nuw nsw i64 %197, 1
  %199 = getelementptr i32, ptr %180, i64 %197
  %200 = load i32, ptr %199, align 4, !tbaa !7
  %201 = getelementptr i32, ptr %0, i64 %197
  store i32 %200, ptr %201, align 4, !tbaa !7
  %202 = add nuw nsw i64 %197, 2
  %203 = getelementptr i32, ptr %180, i64 %198
  %204 = load i32, ptr %203, align 4, !tbaa !7
  %205 = getelementptr i32, ptr %0, i64 %198
  store i32 %204, ptr %205, align 4, !tbaa !7
  %206 = add nuw nsw i64 %197, 3
  %207 = getelementptr i32, ptr %180, i64 %202
  %208 = load i32, ptr %207, align 4, !tbaa !7
  %209 = getelementptr i32, ptr %0, i64 %202
  store i32 %208, ptr %209, align 4, !tbaa !7
  %210 = add nuw nsw i64 %197, 4
  %211 = getelementptr i32, ptr %180, i64 %206
  %212 = load i32, ptr %211, align 4, !tbaa !7
  %213 = getelementptr i32, ptr %0, i64 %206
  store i32 %212, ptr %213, align 4, !tbaa !7
  %exitcond449.not.3 = icmp eq i64 %210, %15
  br i1 %exitcond449.not.3, label %._crit_edge436, label %.lr.ph435, !llvm.loop !14

._crit_edge436:                                   ; preds = %.lr.ph435.prol.loopexit, %.lr.ph435, %middle.block, %179
  call void @free(ptr %180)
  call void @free(ptr %174)
  call void @llvm.stackrestore(ptr %171)
  call void @free(ptr %.fca.0.load107)
  call void @free(ptr %141)
  call void @free(ptr %131)
  call void @free(ptr %.fca.0.load57)
  call void @free(ptr %103)
  call void @free(ptr %95)
  call void @llvm.stackrestore(ptr %92)
  call void @free(ptr %.fca.0.load)
  call void @free(ptr %65)
  br label %.loopexit

.loopexit.loopexit.unr-lcssa:                     ; preds = %23, %.lr.ph437
  %.unr477 = phi i64 [ 0, %.lr.ph437 ], [ %40, %23 ]
  %lcmp.mod478.not = icmp eq i64 %xtraiter476, 0
  br i1 %lcmp.mod478.not, label %.loopexit, label %.epil.preheader475

.epil.preheader475:                               ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader475
  %214 = phi i64 [ %215, %.epil.preheader475 ], [ %.unr477, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader475 ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %215 = add nuw nsw i64 %214, 1
  %216 = mul i64 %19, %214
  %217 = getelementptr i8, ptr %20, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !7
  %219 = getelementptr i32, ptr %0, i64 %214
  store i32 %218, ptr %219, align 4, !tbaa !7
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter476
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.epil.preheader475, !llvm.loop !15

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader475, %.preheader, %._crit_edge436
  ret void
}

; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none)
define void @_QMpiyomodPmka(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #2 {
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %6 = alloca i32, align 4
  %7 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %8 = load i64, ptr %7, align 8, !tbaa !3
  %9 = tail call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = alloca i32, i64 %9, align 4
  %11 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  %12 = load i64, ptr %11, align 8, !tbaa !3
  %13 = tail call i64 @llvm.smax.i64(i64 %12, i64 0)
  %14 = alloca i32, i64 %13, align 4
  %15 = load i32, ptr %0, align 4, !tbaa !7
  %16 = load i32, ptr @_QMpiyomodEn, align 4, !tbaa !7
  %17 = icmp sgt i32 %15, %16
  br i1 %17, label %23, label %.preheader31

.preheader31:                                     ; preds = %3
  %.not37 = icmp slt i64 %8, 1
  br i1 %.not37, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader31
  %18 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %19 = load i64, ptr %18, align 8, !tbaa !3
  %20 = load ptr, ptr %1, align 8, !tbaa !3
  %21 = add nsw i64 %9, -1
  %xtraiter = and i64 %9, 3
  %22 = icmp ult i64 %21, 3
  br i1 %22, label %.preheader.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %9, 9223372036854775804
  br label %65

23:                                               ; preds = %3
  %24 = load i32, ptr @_QMpiyomodEnuma, align 4, !tbaa !7
  %25 = add i32 %24, 1
  store i32 %25, ptr @_QMpiyomodEnuma, align 4, !tbaa !7
  %26 = icmp sgt i32 %16, 0
  br i1 %26, label %.lr.ph36, label %.loopexit

.lr.ph36:                                         ; preds = %23
  %27 = zext i32 %16 to i64
  %28 = sext i32 %25 to i64
  %29 = add nsw i64 %28, -1
  %30 = getelementptr [500000 x i32], ptr @_QMpiyomodEmkdarray, i64 0, i64 %29
  %31 = load ptr, ptr %1, align 8, !tbaa !3
  %32 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %33 = load i64, ptr %32, align 8, !tbaa !3
  %.promoted = load i32, ptr %30, align 4, !tbaa !7
  br label %34

34:                                               ; preds = %.lr.ph36, %__mlir_math_ipowi_i32.exit
  %indvars.iv43 = phi i64 [ 1, %.lr.ph36 ], [ %indvars.iv.next44, %__mlir_math_ipowi_i32.exit ]
  %35 = phi i32 [ %.promoted, %.lr.ph36 ], [ %53, %__mlir_math_ipowi_i32.exit ]
  %36 = add nsw i64 %indvars.iv43, -1
  %37 = mul i64 %33, %36
  %38 = getelementptr i8, ptr %31, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !7
  %40 = icmp eq i64 %36, 0
  br i1 %40, label %__mlir_math_ipowi_i32.exit, label %.preheader.i

.preheader.i:                                     ; preds = %34
  %41 = trunc i64 %36 to i32
  %42 = and i32 %41, 1
  %.not3.i = icmp eq i32 %42, 0
  %43 = select i1 %.not3.i, i32 1, i32 10
  %44 = icmp eq i64 %36, 1
  br i1 %44, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.preheader.i, %.lr.ph.i
  %spec.select4.i = phi i32 [ %spec.select.i, %.lr.ph.i ], [ %43, %.preheader.i ]
  %45 = phi i32 [ %47, %.lr.ph.i ], [ %41, %.preheader.i ]
  %46 = phi i32 [ %48, %.lr.ph.i ], [ 10, %.preheader.i ]
  %47 = lshr i32 %45, 1
  %48 = mul i32 %46, %46
  %49 = and i32 %45, 2
  %.not.i = icmp eq i32 %49, 0
  %50 = select i1 %.not.i, i32 1, i32 %48
  %spec.select.i = mul i32 %50, %spec.select4.i
  %51 = icmp ult i32 %45, 4
  br i1 %51, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i

__mlir_math_ipowi_i32.exit:                       ; preds = %.lr.ph.i, %34, %.preheader.i
  %common.ret.op.i = phi i32 [ 1, %34 ], [ %43, %.preheader.i ], [ %spec.select.i, %.lr.ph.i ]
  %52 = mul i32 %common.ret.op.i, %39
  %53 = add i32 %52, %35
  store i32 %53, ptr %30, align 4, !tbaa !7
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond46.not = icmp eq i64 %indvars.iv43, %27
  br i1 %exitcond46.not, label %.loopexit, label %34

.preheader.loopexit.unr-lcssa:                    ; preds = %65, %.lr.ph
  %.unr = phi i64 [ 0, %.lr.ph ], [ %82, %65 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader.loopexit.unr-lcssa, %.epil.preheader
  %54 = phi i64 [ %55, %.epil.preheader ], [ %.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %55 = add nuw nsw i64 %54, 1
  %56 = mul i64 %19, %54
  %57 = getelementptr i8, ptr %20, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !7
  %59 = getelementptr i32, ptr %10, i64 %54
  store i32 %58, ptr %59, align 4, !tbaa !7
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.epil.preheader, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.epil.preheader, %.preheader31
  %.not38 = icmp slt i64 %12, 1
  br i1 %.not38, label %._crit_edge, label %.lr.ph32

.lr.ph32:                                         ; preds = %.preheader
  %60 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  %61 = load i64, ptr %60, align 8, !tbaa !3
  %62 = load ptr, ptr %2, align 8, !tbaa !3
  %63 = add nsw i64 %13, -1
  %xtraiter52 = and i64 %13, 3
  %64 = icmp ult i64 %63, 3
  br i1 %64, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph32.new

.lr.ph32.new:                                     ; preds = %.lr.ph32
  %unroll_iter56 = and i64 %13, 9223372036854775804
  br label %87

65:                                               ; preds = %65, %.lr.ph.new
  %66 = phi i64 [ 0, %.lr.ph.new ], [ %82, %65 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %65 ]
  %67 = or i64 %66, 1
  %68 = mul i64 %19, %66
  %69 = getelementptr i8, ptr %20, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !7
  %71 = getelementptr i32, ptr %10, i64 %66
  store i32 %70, ptr %71, align 4, !tbaa !7
  %72 = or i64 %66, 2
  %73 = mul i64 %19, %67
  %74 = getelementptr i8, ptr %20, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !7
  %76 = getelementptr i32, ptr %10, i64 %67
  store i32 %75, ptr %76, align 4, !tbaa !7
  %77 = or i64 %66, 3
  %78 = mul i64 %19, %72
  %79 = getelementptr i8, ptr %20, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !7
  %81 = getelementptr i32, ptr %10, i64 %72
  store i32 %80, ptr %81, align 4, !tbaa !7
  %82 = add nuw nsw i64 %66, 4
  %83 = mul i64 %19, %77
  %84 = getelementptr i8, ptr %20, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !7
  %86 = getelementptr i32, ptr %10, i64 %77
  store i32 %85, ptr %86, align 4, !tbaa !7
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.loopexit.unr-lcssa, label %65

87:                                               ; preds = %87, %.lr.ph32.new
  %88 = phi i64 [ 0, %.lr.ph32.new ], [ %104, %87 ]
  %niter57 = phi i64 [ 0, %.lr.ph32.new ], [ %niter57.next.3, %87 ]
  %89 = or i64 %88, 1
  %90 = mul i64 %61, %88
  %91 = getelementptr i8, ptr %62, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !7
  %93 = getelementptr i32, ptr %14, i64 %88
  store i32 %92, ptr %93, align 4, !tbaa !7
  %94 = or i64 %88, 2
  %95 = mul i64 %61, %89
  %96 = getelementptr i8, ptr %62, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !7
  %98 = getelementptr i32, ptr %14, i64 %89
  store i32 %97, ptr %98, align 4, !tbaa !7
  %99 = or i64 %88, 3
  %100 = mul i64 %61, %94
  %101 = getelementptr i8, ptr %62, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !7
  %103 = getelementptr i32, ptr %14, i64 %94
  store i32 %102, ptr %103, align 4, !tbaa !7
  %104 = add nuw nsw i64 %88, 4
  %105 = mul i64 %61, %99
  %106 = getelementptr i8, ptr %62, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !7
  %108 = getelementptr i32, ptr %14, i64 %99
  store i32 %107, ptr %108, align 4, !tbaa !7
  %niter57.next.3 = add i64 %niter57, 4
  %niter57.ncmp.3 = icmp eq i64 %niter57.next.3, %unroll_iter56
  br i1 %niter57.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %87

._crit_edge.loopexit.unr-lcssa:                   ; preds = %87, %.lr.ph32
  %.unr54 = phi i64 [ 0, %.lr.ph32 ], [ %104, %87 ]
  %lcmp.mod55.not = icmp eq i64 %xtraiter52, 0
  br i1 %lcmp.mod55.not, label %._crit_edge, label %.epil.preheader51

.epil.preheader51:                                ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader51
  %109 = phi i64 [ %110, %.epil.preheader51 ], [ %.unr54, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter53 = phi i64 [ %epil.iter53.next, %.epil.preheader51 ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %110 = add nuw nsw i64 %109, 1
  %111 = mul i64 %61, %109
  %112 = getelementptr i8, ptr %62, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !7
  %114 = getelementptr i32, ptr %14, i64 %109
  store i32 %113, ptr %114, align 4, !tbaa !7
  %epil.iter53.next = add i64 %epil.iter53, 1
  %epil.iter53.cmp.not = icmp eq i64 %epil.iter53.next, %xtraiter52
  br i1 %epil.iter53.cmp.not, label %._crit_edge, label %.epil.preheader51, !llvm.loop !17

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader51, %.preheader
  %115 = icmp sgt i32 %16, 0
  br i1 %115, label %.lr.ph34, label %.loopexit

.lr.ph34:                                         ; preds = %._crit_edge
  %116 = zext i32 %16 to i64
  %117 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 6
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 2
  %.fca.1.gep10 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 1
  %.fca.2.gep12 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 2
  %.fca.3.gep14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 3
  %.fca.4.gep16 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 4
  %.fca.5.gep18 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 5
  %.fca.6.gep20 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 6
  %.fca.7.0.0.gep22 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep24 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep26 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 2
  %.pre47 = load ptr, ptr %2, align 8, !tbaa !3
  br label %118

118:                                              ; preds = %.lr.ph34, %133
  %119 = phi ptr [ %.pre47, %.lr.ph34 ], [ %134, %133 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph34 ], [ %indvars.iv.next, %133 ]
  %120 = add nsw i64 %indvars.iv, -1
  %121 = load i64, ptr %117, align 8, !tbaa !3
  %122 = mul i64 %121, %120
  %123 = getelementptr i8, ptr %119, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !7
  %.not = icmp eq i32 %124, 0
  br i1 %.not, label %125, label %133

125:                                              ; preds = %118
  %126 = load i32, ptr %0, align 4, !tbaa !7
  %127 = sext i32 %126 to i64
  %128 = add nsw i64 %127, -1
  %129 = getelementptr i32, ptr %10, i64 %128
  %130 = trunc i64 %indvars.iv to i32
  store i32 %130, ptr %129, align 4, !tbaa !7
  %131 = getelementptr i32, ptr %14, i64 %120
  store i32 1, ptr %131, align 4, !tbaa !7
  %132 = add i32 %126, 1
  store i32 %132, ptr %6, align 4, !tbaa !7
  store ptr %10, ptr %5, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  store i64 %9, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  store ptr %14, ptr %4, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep10, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep12, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep14, align 4, !tbaa !3
  store i8 14, ptr %.fca.4.gep16, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep18, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep20, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep22, align 8, !tbaa !3
  store i64 %13, ptr %.fca.7.0.1.gep24, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep26, align 8, !tbaa !3
  call void @_QMpiyomodPmka(ptr nonnull %6, ptr nonnull %5, ptr nonnull %4)
  store i32 0, ptr %131, align 4, !tbaa !7
  %.pre = load ptr, ptr %2, align 8, !tbaa !3
  br label %133

133:                                              ; preds = %125, %118
  %134 = phi ptr [ %.pre, %125 ], [ %119, %118 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond42.not = icmp eq i64 %indvars.iv, %116
  br i1 %exitcond42.not, label %.loopexit, label %118

.loopexit:                                        ; preds = %133, %__mlir_math_ipowi_i32.exit, %._crit_edge, %23
  ret void
}

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %6 = alloca i32, align 4
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 92)
  %8 = tail call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull @_QMpiyomodEn, i32 4)
  %9 = tail call i32 @_FortranAioEndIoStatement(ptr %7)
  %10 = load i32, ptr @_QMpiyomodEn, align 4, !tbaa !7
  %11 = tail call i32 @llvm.smax.i32(i32 %10, i32 0)
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %12, 2
  %14 = tail call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEp.0, align 8, !tbaa !3
  %15 = tail call ptr @malloc(i64 %13)
  store ptr %15, ptr @_QFEq.0, align 8, !tbaa !3
  %16 = tail call ptr @malloc(i64 %13)
  store ptr %16, ptr @_QFEdummy.0, align 8, !tbaa !3
  store i64 %12, ptr @_QFEdummy.8, align 8, !tbaa !3
  %17 = tail call ptr @malloc(i64 %13)
  store ptr %17, ptr @_QFEflag.0, align 8, !tbaa !3
  store i64 1, ptr @_QFEflag.7, align 8, !tbaa !3
  store i64 %12, ptr @_QFEflag.8, align 8, !tbaa !3
  %18 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 94)
  %.unpack = load ptr, ptr @_QFEp.0, align 8, !tbaa !3
  %19 = load i32, ptr @_QMpiyomodEn, align 4, !tbaa !7
  %20 = sext i32 %19 to i64
  %21 = add nsw i64 %20, -1
  %22 = tail call i64 @llvm.smax.i64(i64 %20, i64 0)
  %23 = getelementptr i32, ptr %.unpack, i64 %21
  store ptr %23, ptr %5, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 1
  store i64 %22, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 2
  store i64 -4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %24 = call i1 @_FortranAioInputDescriptor(ptr %18, ptr nonnull %5)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %26 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 95)
  %.unpack560 = load ptr, ptr @_QFEq.0, align 8, !tbaa !3
  %27 = load i32, ptr @_QMpiyomodEn, align 4, !tbaa !7
  %28 = sext i32 %27 to i64
  %29 = add nsw i64 %28, -1
  %30 = call i64 @llvm.smax.i64(i64 %28, i64 0)
  %31 = getelementptr i32, ptr %.unpack560, i64 %29
  store ptr %31, ptr %4, align 8, !tbaa !3
  %.fca.1.gep200 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep200, align 8, !tbaa !3
  %.fca.2.gep202 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep202, align 8, !tbaa !3
  %.fca.3.gep204 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep204, align 4, !tbaa !3
  %.fca.4.gep206 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep206, align 1, !tbaa !3
  %.fca.5.gep208 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep208, align 2, !tbaa !3
  %.fca.6.gep210 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep210, align 1, !tbaa !3
  %.fca.7.0.0.gep212 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep212, align 8, !tbaa !3
  %.fca.7.0.1.gep214 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 1
  store i64 %30, ptr %.fca.7.0.1.gep214, align 8, !tbaa !3
  %.fca.7.0.2.gep216 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 2
  store i64 -4, ptr %.fca.7.0.2.gep216, align 8, !tbaa !3
  %32 = call i1 @_FortranAioInputDescriptor(ptr %26, ptr nonnull %4)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %26)
  %.unpack572 = load ptr, ptr @_QFEflag.0, align 8, !tbaa !3
  %.unpack579.unpack.unpack581 = load i64, ptr @_QFEflag.8, align 8, !tbaa !3
  %.not = icmp eq ptr %.unpack572, null
  br i1 %.not, label %36, label %.preheader

.preheader:                                       ; preds = %0
  %34 = icmp sgt i64 %.unpack579.unpack.unpack581, 0
  br i1 %34, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %35 = shl nuw i64 %.unpack579.unpack.unpack581, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %.unpack572, i8 0, i64 %35, i1 false), !tbaa !7
  br label %.loopexit

36:                                               ; preds = %0
  %37 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 99)
  %.unpack640.unpack.unpack = load i64, ptr @_QFEflag.7, align 8, !tbaa !3
  %38 = icmp eq i64 %.unpack579.unpack.unpack581, 0
  %39 = select i1 %38, i64 1, i64 %.unpack640.unpack.unpack
  store ptr null, ptr @_QFEflag.0, align 8, !tbaa !3
  store i64 %39, ptr @_QFEflag.7, align 8, !tbaa !3
  store i64 %.unpack579.unpack.unpack581, ptr @_QFEflag.8, align 8, !tbaa !3
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.preheader, %.preheader, %36
  store i32 1, ptr %6, align 4, !tbaa !7
  %.unpack584 = load ptr, ptr @_QFEdummy.0, align 8, !tbaa !3
  %.unpack591.unpack.unpack593 = load i64, ptr @_QFEdummy.8, align 8, !tbaa !3
  store ptr %.unpack584, ptr %3, align 8, !tbaa !3
  %.fca.1.gep282 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep282, align 8, !tbaa !3
  %.fca.2.gep284 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep284, align 8, !tbaa !3
  %.fca.3.gep286 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep286, align 4, !tbaa !3
  %.fca.4.gep288 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep288, align 1, !tbaa !3
  %.fca.5.gep290 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep290, align 2, !tbaa !3
  %.fca.6.gep292 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep292, align 1, !tbaa !3
  %.fca.7.0.0.gep294 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep294, align 8, !tbaa !3
  %.fca.7.0.1.gep296 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack591.unpack.unpack593, ptr %.fca.7.0.1.gep296, align 8, !tbaa !3
  %.fca.7.0.2.gep298 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep298, align 8, !tbaa !3
  %.unpack603.unpack.unpack = load i64, ptr @_QFEflag.7, align 8, !tbaa !3
  %40 = icmp eq i64 %.unpack579.unpack.unpack581, 0
  %41 = select i1 %40, i64 1, i64 %.unpack603.unpack.unpack
  store ptr %.unpack572, ptr %2, align 8, !tbaa !3
  %.fca.1.gep332 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep332, align 8, !tbaa !3
  %.fca.2.gep334 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep334, align 8, !tbaa !3
  %.fca.3.gep336 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep336, align 4, !tbaa !3
  %.fca.4.gep338 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 14, ptr %.fca.4.gep338, align 1, !tbaa !3
  %.fca.5.gep340 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep340, align 2, !tbaa !3
  %.fca.6.gep342 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep342, align 1, !tbaa !3
  %.fca.7.0.0.gep344 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  store i64 %41, ptr %.fca.7.0.0.gep344, align 8, !tbaa !3
  %.fca.7.0.1.gep346 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack579.unpack.unpack581, ptr %.fca.7.0.1.gep346, align 8, !tbaa !3
  %.fca.7.0.2.gep348 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep348, align 8, !tbaa !3
  call void @_QMpiyomodPmka(ptr nonnull %6, ptr nonnull %3, ptr nonnull %2)
  %42 = load i32, ptr @_QMpiyomodEnuma, align 4, !tbaa !7
  %43 = call i32 @llvm.smax.i32(i32 %42, i32 0)
  %44 = zext i32 %43 to i64
  store ptr @_QMpiyomodEmkdarray, ptr %1, align 8, !tbaa !3
  %.fca.1.gep352 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep352, align 8, !tbaa !3
  %.fca.2.gep354 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep354, align 8, !tbaa !3
  %.fca.3.gep356 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep356, align 4, !tbaa !3
  %.fca.4.gep358 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep358, align 1, !tbaa !3
  %.fca.5.gep360 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep360, align 2, !tbaa !3
  %.fca.6.gep362 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep362, align 1, !tbaa !3
  %.fca.7.0.0.gep364 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep364, align 8, !tbaa !3
  %.fca.7.0.1.gep366 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %44, ptr %.fca.7.0.1.gep366, align 8, !tbaa !3
  %.fca.7.0.2.gep368 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep368, align 8, !tbaa !3
  %.not608 = icmp slt i32 %42, 1
  %45 = select i1 %.not608, i64 0, i64 %44
  %46 = call ptr @llvm.stacksave()
  %47 = alloca i32, i64 %45, align 4
  call void @_QMintqsortmodPintqsort(ptr nonnull %47, ptr nonnull %1)
  br i1 %.not608, label %._crit_edge, label %.lr.ph662.preheader

.lr.ph662.preheader:                              ; preds = %.loopexit
  %48 = call i64 @llvm.smax.i64(i64 %44, i64 1)
  %49 = shl nuw nsw i64 %48, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_QMpiyomodEmkdarray, ptr nonnull align 4 %47, i64 %49, i1 false), !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph662.preheader, %.loopexit
  call void @llvm.stackrestore(ptr %46)
  %50 = load i32, ptr @_QMpiyomodEn, align 4, !tbaa !7
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph664, label %95

.lr.ph664:                                        ; preds = %._crit_edge
  %52 = zext i32 %50 to i64
  %_QFEvalq.promoted = load i32, ptr @_QFEvalq, align 4, !tbaa !7
  %_QFEvalp.promoted = load i32, ptr @_QFEvalp, align 4, !tbaa !7
  %.unpack609 = load ptr, ptr @_QFEp.0, align 8, !tbaa !3
  %.unpack621 = load ptr, ptr @_QFEq.0, align 8, !tbaa !3
  br label %53

53:                                               ; preds = %.lr.ph664, %__mlir_math_ipowi_i32.exit661
  %indvars.iv = phi i64 [ 1, %.lr.ph664 ], [ %indvars.iv.next, %__mlir_math_ipowi_i32.exit661 ]
  %54 = phi i32 [ %_QFEvalp.promoted, %.lr.ph664 ], [ %92, %__mlir_math_ipowi_i32.exit661 ]
  %55 = phi i32 [ %_QFEvalq.promoted, %.lr.ph664 ], [ %94, %__mlir_math_ipowi_i32.exit661 ]
  %56 = add nsw i64 %indvars.iv, -1
  %57 = getelementptr i32, ptr %.unpack609, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !7
  %59 = add nsw i64 %indvars.iv, -1
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %__mlir_math_ipowi_i32.exit661.sink.split, label %.preheader.i

.preheader.i:                                     ; preds = %53
  %61 = trunc i64 %59 to i32
  %62 = and i32 %61, 1
  %.not3.i = icmp eq i32 %62, 0
  %63 = select i1 %.not3.i, i32 1, i32 10
  %64 = icmp eq i64 %59, 1
  br i1 %64, label %.preheader.i656.thread, label %.lr.ph.i

.preheader.i656.thread:                           ; preds = %.preheader.i
  %65 = mul i32 %63, %58
  br label %__mlir_math_ipowi_i32.exit661.sink.split

.lr.ph.i:                                         ; preds = %.preheader.i, %.lr.ph.i
  %spec.select4.i = phi i32 [ %spec.select.i, %.lr.ph.i ], [ %63, %.preheader.i ]
  %66 = phi i32 [ %68, %.lr.ph.i ], [ %61, %.preheader.i ]
  %67 = phi i32 [ %69, %.lr.ph.i ], [ 10, %.preheader.i ]
  %68 = lshr i32 %66, 1
  %69 = mul i32 %67, %67
  %70 = and i32 %66, 2
  %.not.i = icmp eq i32 %70, 0
  %71 = select i1 %.not.i, i32 1, i32 %69
  %spec.select.i = mul i32 %71, %spec.select4.i
  %72 = icmp ult i32 %66, 4
  br i1 %72, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i

__mlir_math_ipowi_i32.exit:                       ; preds = %.lr.ph.i
  %73 = mul i32 %spec.select.i, %58
  %74 = add nsw i64 %indvars.iv, -1
  %75 = getelementptr i32, ptr %.unpack621, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !7
  br i1 %60, label %__mlir_math_ipowi_i32.exit661, label %.preheader.i656

.preheader.i656:                                  ; preds = %__mlir_math_ipowi_i32.exit
  %77 = trunc i64 %59 to i32
  %78 = and i32 %77, 1
  %.not3.i655 = icmp eq i32 %78, 0
  %79 = select i1 %.not3.i655, i32 1, i32 10
  %80 = icmp eq i64 %59, 1
  br i1 %80, label %__mlir_math_ipowi_i32.exit661, label %.lr.ph.i660

.lr.ph.i660:                                      ; preds = %.preheader.i656, %.lr.ph.i660
  %spec.select4.i657 = phi i32 [ %spec.select.i659, %.lr.ph.i660 ], [ %79, %.preheader.i656 ]
  %81 = phi i32 [ %83, %.lr.ph.i660 ], [ %77, %.preheader.i656 ]
  %82 = phi i32 [ %84, %.lr.ph.i660 ], [ 10, %.preheader.i656 ]
  %83 = lshr i32 %81, 1
  %84 = mul i32 %82, %82
  %85 = and i32 %81, 2
  %.not.i658 = icmp eq i32 %85, 0
  %86 = select i1 %.not.i658, i32 1, i32 %84
  %spec.select.i659 = mul i32 %86, %spec.select4.i657
  %87 = icmp ult i32 %81, 4
  br i1 %87, label %__mlir_math_ipowi_i32.exit661, label %.lr.ph.i660

__mlir_math_ipowi_i32.exit661.sink.split:         ; preds = %53, %.preheader.i656.thread
  %.sink = phi i32 [ %65, %.preheader.i656.thread ], [ %58, %53 ]
  %common.ret.op.i654.ph = phi i32 [ 10, %.preheader.i656.thread ], [ 1, %53 ]
  %88 = add nsw i64 %indvars.iv, -1
  %89 = getelementptr i32, ptr %.unpack621, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !7
  br label %__mlir_math_ipowi_i32.exit661

__mlir_math_ipowi_i32.exit661:                    ; preds = %.lr.ph.i660, %__mlir_math_ipowi_i32.exit661.sink.split, %__mlir_math_ipowi_i32.exit, %.preheader.i656
  %91 = phi i32 [ %76, %__mlir_math_ipowi_i32.exit ], [ %76, %.preheader.i656 ], [ %90, %__mlir_math_ipowi_i32.exit661.sink.split ], [ %76, %.lr.ph.i660 ]
  %.pn = phi i32 [ %73, %__mlir_math_ipowi_i32.exit ], [ %73, %.preheader.i656 ], [ %.sink, %__mlir_math_ipowi_i32.exit661.sink.split ], [ %73, %.lr.ph.i660 ]
  %common.ret.op.i654 = phi i32 [ 1, %__mlir_math_ipowi_i32.exit ], [ %79, %.preheader.i656 ], [ %common.ret.op.i654.ph, %__mlir_math_ipowi_i32.exit661.sink.split ], [ %spec.select.i659, %.lr.ph.i660 ]
  %92 = add i32 %.pn, %54
  %93 = mul i32 %common.ret.op.i654, %91
  %94 = add i32 %93, %55
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %52
  br i1 %exitcond.not, label %._crit_edge665, label %53

._crit_edge665:                                   ; preds = %__mlir_math_ipowi_i32.exit661
  store i32 %92, ptr @_QFEvalp, align 4, !tbaa !7
  store i32 %94, ptr @_QFEvalq, align 4, !tbaa !7
  br label %95

95:                                               ; preds = %._crit_edge665, %._crit_edge
  %96 = load i32, ptr @_QMpiyomodEnuma, align 4, !tbaa !7
  %97 = icmp sgt i32 %96, 0
  br i1 %97, label %.lr.ph670, label %._crit_edge671

.lr.ph670:                                        ; preds = %95
  %98 = zext i32 %96 to i64
  %99 = load i32, ptr @_QFEvalp, align 4, !tbaa !7
  %100 = load i32, ptr @_QFEvalq, align 4, !tbaa !7
  %xtraiter = and i64 %98, 1
  %101 = icmp eq i32 %96, 1
  br i1 %101, label %._crit_edge671.loopexit.unr-lcssa, label %.lr.ph670.new

.lr.ph670.new:                                    ; preds = %.lr.ph670
  %unroll_iter = and i64 %98, 4294967294
  br label %102

102:                                              ; preds = %102, %.lr.ph670.new
  %indvars.iv676 = phi i64 [ 1, %.lr.ph670.new ], [ %indvars.iv.next677.1, %102 ]
  %.0668 = phi i32 [ undef, %.lr.ph670.new ], [ %.1.1, %102 ]
  %.0507667 = phi i32 [ undef, %.lr.ph670.new ], [ %spec.select.1, %102 ]
  %niter = phi i64 [ 0, %.lr.ph670.new ], [ %niter.next.1, %102 ]
  %103 = add nsw i64 %indvars.iv676, -1
  %104 = getelementptr [500000 x i32], ptr @_QMpiyomodEmkdarray, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !7
  %106 = icmp eq i32 %105, %99
  %107 = trunc i64 %indvars.iv676 to i32
  %spec.select = select i1 %106, i32 %107, i32 %.0507667
  %108 = icmp eq i32 %105, %100
  %.1 = select i1 %108, i32 %107, i32 %.0668
  %109 = getelementptr [500000 x i32], ptr @_QMpiyomodEmkdarray, i64 0, i64 %indvars.iv676
  %110 = load i32, ptr %109, align 4, !tbaa !7
  %111 = icmp eq i32 %110, %99
  %112 = trunc i64 %indvars.iv676 to i32
  %113 = add i32 %112, 1
  %spec.select.1 = select i1 %111, i32 %113, i32 %spec.select
  %114 = icmp eq i32 %110, %100
  %.1.1 = select i1 %114, i32 %113, i32 %.1
  %indvars.iv.next677.1 = add nuw nsw i64 %indvars.iv676, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge671.loopexit.unr-lcssa, label %102

._crit_edge671.loopexit.unr-lcssa:                ; preds = %102, %.lr.ph670
  %indvars.iv676.unr = phi i64 [ 1, %.lr.ph670 ], [ %indvars.iv.next677.1, %102 ]
  %.0668.unr = phi i32 [ undef, %.lr.ph670 ], [ %.1.1, %102 ]
  %.0507667.unr = phi i32 [ undef, %.lr.ph670 ], [ %spec.select.1, %102 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge671, label %._crit_edge671.loopexit.epilog-lcssa

._crit_edge671.loopexit.epilog-lcssa:             ; preds = %._crit_edge671.loopexit.unr-lcssa
  %115 = add nsw i64 %indvars.iv676.unr, -1
  %116 = getelementptr [500000 x i32], ptr @_QMpiyomodEmkdarray, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !7
  %118 = icmp eq i32 %117, %99
  %119 = trunc i64 %indvars.iv676.unr to i32
  %spec.select.epil = select i1 %118, i32 %119, i32 %.0507667.unr
  %120 = icmp eq i32 %117, %100
  %.1.epil = select i1 %120, i32 %119, i32 %.0668.unr
  br label %._crit_edge671

._crit_edge671:                                   ; preds = %._crit_edge671.loopexit.epilog-lcssa, %._crit_edge671.loopexit.unr-lcssa, %95
  %.0507.lcssa = phi i32 [ undef, %95 ], [ %.0507667.unr, %._crit_edge671.loopexit.unr-lcssa ], [ %spec.select.epil, %._crit_edge671.loopexit.epilog-lcssa ]
  %.0.lcssa = phi i32 [ undef, %95 ], [ %.0668.unr, %._crit_edge671.loopexit.unr-lcssa ], [ %.1.epil, %._crit_edge671.loopexit.epilog-lcssa ]
  %121 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8b239cae78ec892f49a01df4d229da38, i32 120)
  %122 = sub i32 %.0507.lcssa, %.0.lcssa
  %123 = call i32 @llvm.abs.i32(i32 %122, i1 false)
  %124 = call i1 @_FortranAioOutputInteger32(ptr %121, i32 %123)
  %125 = call i32 @_FortranAioEndIoStatement(ptr %121)
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture, i64 noundef) local_unnamed_addr #3

declare {} @_FortranAPack(ptr, ptr, ptr, ptr, ptr, i32) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave() #4

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore(ptr) #4

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 i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
