      MODULE divisorMod
      IMPLICIT NONE
      
      contains
      function allDivisor( N ) result( resArray )
        implicit none
        integer(16),intent(in) :: N
        integer(16),allocatable :: resArray(:),buffer(:)
        integer(16) :: i,c
        
        !N must be N>=1
        !resArray must be deallocated
        
        allocate( buffer(floor(sqrt(real(N)))*2) )
        
        !c : counter
        c = 1
        do i = 1,floor(sqrt(real(N+1)))
          if( mod(N,i)==0 )then
            buffer(c) = i
            c = c + 1
          end if
        end do
        
        !c is allways over 1
        c = c - 1
        
        
        if( buffer(c)*buffer(c)==N )then
          !n is Square number
          buffer(c:2*c-1) = N / buffer(c:1:-1)
          c = 2*c - 1
        else
          buffer(c+1:2*c) = N / buffer(c:1:-1)
          c = 2*c
        end if
        
        !c is now number of divisor
        allocate( resArray(1:c) )
        resArray(1:c) = buffer(1:c)
      end function allDivisor
      END MODULE divisorMod


      PROGRAM divisionOrSubtraction
      use divisorMod
      IMPLICIT NONE
      integer(16) :: ans,n,k,sz,i,m
      integer(16),allocatable :: divisor(:)
      
      read*,n
      
      !case: only subtraction
      ans = size( allDivisor(n-1) )
      !divisor 1 would be excepted
      ans = ans - 1
      
      divisor = allDivisor( n )
      sz = size( divisor )
      
      !for all divisors
      do i = 2,sz
      m = n
        do while(.true.)
          
          if( mod( m,divisor(i) )==0 )then
            m = m / divisor(i)
            
          else
            exit
          end if
          
        end do
        if( mod(m,divisor(i))==1 ) ans = ans + 1
      end do
      
      print*,ans
      
      
      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"

@_QQcl.64e48d2bc2f38e3c8a95f4cc5912bf42 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1918/source.f\00"
@_QFEdivisor.0 = internal unnamed_addr global ptr null
@_QFEdivisor.8 = internal unnamed_addr global i64 0
@_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

; Function Attrs: nounwind
define void @_QMdivisormodPalldivisor(ptr nocapture writeonly %0, ptr nocapture readonly %1) local_unnamed_addr #2 {
  store ptr null, ptr %0, align 8, !tbaa !3
  %.repack90 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  store i64 16, ptr %.repack90, align 8, !tbaa !3
  %.repack91 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 2
  store i32 20180515, ptr %.repack91, align 8, !tbaa !3
  %.repack92 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 3
  store i8 1, ptr %.repack92, align 4, !tbaa !3
  %.repack93 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 4
  store i8 11, ptr %.repack93, align 1, !tbaa !3
  %.repack94 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 5
  store i8 2, ptr %.repack94, align 2, !tbaa !3
  %.repack95 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 6
  store i8 0, ptr %.repack95, align 1, !tbaa !3
  %.repack96 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  store i64 1, ptr %.repack96, align 8, !tbaa !3
  %.repack96.repack97 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  store i64 0, ptr %.repack96.repack97, align 8, !tbaa !3
  %.repack96.repack98 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  store i64 16, ptr %.repack96.repack98, align 8, !tbaa !3
  %3 = load i128, ptr %1, align 8, !tbaa !7
  %4 = sitofp i128 %3 to float
  %5 = tail call contract float @llvm.sqrt.f32(float %4)
  %6 = tail call contract float @llvm.floor.f32(float %5)
  %7 = fptosi float %6 to i32
  %8 = shl i32 %7, 1
  %9 = tail call i32 @llvm.smax.i32(i32 %8, i32 0)
  %10 = zext i32 %9 to i64
  %11 = shl nuw nsw i64 %10, 4
  %12 = tail call ptr @malloc(i64 %11)
  %13 = add i128 %3, 1
  %14 = sitofp i128 %13 to float
  %15 = tail call contract float @llvm.sqrt.f32(float %14)
  %16 = tail call contract float @llvm.floor.f32(float %15)
  %17 = fptosi float %16 to i32
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %19 = zext i32 %17 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %29
  %20 = phi i64 [ %31, %29 ], [ %19, %.lr.ph.preheader ]
  %21 = phi i128 [ %30, %29 ], [ 1, %.lr.ph.preheader ]
  %.0123 = phi i128 [ %.1, %29 ], [ 1, %.lr.ph.preheader ]
  %22 = srem i128 %3, %21
  %23 = icmp eq i128 %22, 0
  br i1 %23, label %24, label %29

24:                                               ; preds = %.lr.ph
  %25 = trunc i128 %.0123 to i64
  %26 = add i64 %25, -1
  %27 = getelementptr i128, ptr %12, i64 %26
  store i128 %21, ptr %27, align 8, !tbaa !7
  %28 = add i128 %.0123, 1
  br label %29

29:                                               ; preds = %24, %.lr.ph
  %.1 = phi i128 [ %28, %24 ], [ %.0123, %.lr.ph ]
  %30 = add nuw nsw i128 %21, 1
  %31 = add nsw i64 %20, -1
  %32 = icmp sgt i64 %20, 1
  br i1 %32, label %.lr.ph, label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %29
  %extract.t = trunc i128 %.1 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.0.lcssa.off0 = phi i64 [ 1, %2 ], [ %extract.t, %._crit_edge.loopexit ]
  %33 = add i64 %.0.lcssa.off0, -1
  %34 = add i64 %.0.lcssa.off0, -2
  %35 = getelementptr i128, ptr %12, i64 %34
  %36 = load i128, ptr %35, align 8, !tbaa !7
  %37 = mul i128 %36, %36
  %38 = icmp eq i128 %37, %3
  %39 = shl i64 %33, 1
  br i1 %38, label %40, label %69

40:                                               ; preds = %._crit_edge
  %41 = add i64 %39, -1
  %42 = tail call i64 @llvm.smax.i64(i64 %33, i64 0)
  %43 = tail call ptr @malloc(i64 %11)
  %.not140 = icmp slt i32 %8, 1
  br i1 %.not140, label %.preheader120, label %.lr.ph130.preheader

.lr.ph130.preheader:                              ; preds = %40
  %44 = or i64 %10, 1
  %smin144 = tail call i64 @llvm.smin.i64(i64 %10, i64 1)
  %45 = sub nuw nsw i64 %44, %smin144
  %46 = shl nuw nsw i64 %45, 4
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %43, ptr nonnull align 8 %12, i64 %46, i1 false), !tbaa !7
  br label %.preheader120

.preheader120:                                    ; preds = %.lr.ph130.preheader, %40
  %.not141 = icmp slt i64 %33, 1
  br i1 %.not141, label %.preheader, label %.lr.ph131.preheader

.lr.ph131.preheader:                              ; preds = %.preheader120
  %xtraiter151 = and i64 %42, 1
  %47 = icmp eq i64 %42, 1
  br i1 %47, label %.preheader.loopexit.unr-lcssa, label %.lr.ph131.preheader.new

.lr.ph131.preheader.new:                          ; preds = %.lr.ph131.preheader
  %unroll_iter154 = and i64 %42, 9223372036854775806
  br label %.lr.ph131

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph131, %.lr.ph131.preheader
  %.unr152 = phi i64 [ 0, %.lr.ph131.preheader ], [ %62, %.lr.ph131 ]
  %lcmp.mod153.not = icmp eq i64 %xtraiter151, 0
  br i1 %lcmp.mod153.not, label %.preheader, label %.lr.ph131.epil

.lr.ph131.epil:                                   ; preds = %.preheader.loopexit.unr-lcssa
  %48 = sub i64 %34, %.unr152
  %49 = getelementptr i128, ptr %12, i64 %48
  %50 = load i128, ptr %49, align 8, !tbaa !7
  %51 = sdiv i128 %3, %50
  %52 = add i64 %.unr152, %34
  %53 = getelementptr i128, ptr %43, i64 %52
  store i128 %51, ptr %53, align 8, !tbaa !7
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph131.epil, %.preheader.loopexit.unr-lcssa, %.preheader120
  br i1 %.not140, label %._crit_edge133, label %._crit_edge133.sink.split

.lr.ph131:                                        ; preds = %.lr.ph131, %.lr.ph131.preheader.new
  %54 = phi i64 [ 0, %.lr.ph131.preheader.new ], [ %62, %.lr.ph131 ]
  %niter155 = phi i64 [ 0, %.lr.ph131.preheader.new ], [ %niter155.next.1, %.lr.ph131 ]
  %55 = or i64 %54, 1
  %56 = sub i64 %34, %54
  %57 = getelementptr i128, ptr %12, i64 %56
  %58 = load i128, ptr %57, align 8, !tbaa !7
  %59 = sdiv i128 %3, %58
  %60 = add i64 %54, %34
  %61 = getelementptr i128, ptr %43, i64 %60
  store i128 %59, ptr %61, align 8, !tbaa !7
  %62 = add nuw nsw i64 %54, 2
  %63 = sub i64 %34, %55
  %64 = getelementptr i128, ptr %12, i64 %63
  %65 = load i128, ptr %64, align 8, !tbaa !7
  %66 = sdiv i128 %3, %65
  %67 = add i64 %55, %34
  %68 = getelementptr i128, ptr %43, i64 %67
  store i128 %66, ptr %68, align 8, !tbaa !7
  %niter155.next.1 = add i64 %niter155, 2
  %niter155.ncmp.1 = icmp eq i64 %niter155.next.1, %unroll_iter154
  br i1 %niter155.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph131

69:                                               ; preds = %._crit_edge
  %70 = sub i64 1, %.0.lcssa.off0
  %71 = add i64 %70, %39
  %72 = tail call i64 @llvm.smax.i64(i64 %71, i64 0)
  %73 = tail call ptr @malloc(i64 %11)
  %.not = icmp slt i32 %8, 1
  br i1 %.not, label %.preheader122, label %.lr.ph125.preheader

.lr.ph125.preheader:                              ; preds = %69
  %74 = or i64 %10, 1
  %smin = tail call i64 @llvm.smin.i64(i64 %10, i64 1)
  %75 = sub nuw nsw i64 %74, %smin
  %76 = shl nuw nsw i64 %75, 4
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %73, ptr nonnull align 8 %12, i64 %76, i1 false), !tbaa !7
  br label %.preheader122

.preheader122:                                    ; preds = %.lr.ph125.preheader, %69
  %.not137 = icmp slt i64 %71, 1
  br i1 %.not137, label %.preheader121, label %.lr.ph126

.lr.ph126:                                        ; preds = %.preheader122
  %77 = add i64 %.0.lcssa.off0, -1
  %xtraiter = and i64 %72, 1
  %78 = icmp eq i64 %72, 1
  br i1 %78, label %.preheader121.loopexit.unr-lcssa, label %.lr.ph126.new

.lr.ph126.new:                                    ; preds = %.lr.ph126
  %unroll_iter = and i64 %72, 9223372036854775806
  br label %85

.preheader121.loopexit.unr-lcssa:                 ; preds = %85, %.lr.ph126
  %.unr = phi i64 [ 0, %.lr.ph126 ], [ %94, %85 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader121, label %.preheader121.loopexit.epilog-lcssa

.preheader121.loopexit.epilog-lcssa:              ; preds = %.preheader121.loopexit.unr-lcssa
  %79 = sub i64 %34, %.unr
  %80 = getelementptr i128, ptr %12, i64 %79
  %81 = load i128, ptr %80, align 8, !tbaa !7
  %82 = sdiv i128 %3, %81
  %83 = add i64 %77, %.unr
  %84 = getelementptr i128, ptr %73, i64 %83
  store i128 %82, ptr %84, align 8, !tbaa !7
  br label %.preheader121

.preheader121:                                    ; preds = %.preheader121.loopexit.epilog-lcssa, %.preheader121.loopexit.unr-lcssa, %.preheader122
  br i1 %.not, label %._crit_edge133, label %._crit_edge133.sink.split

85:                                               ; preds = %85, %.lr.ph126.new
  %86 = phi i64 [ 0, %.lr.ph126.new ], [ %94, %85 ]
  %niter = phi i64 [ 0, %.lr.ph126.new ], [ %niter.next.1, %85 ]
  %87 = or i64 %86, 1
  %88 = sub i64 %34, %86
  %89 = getelementptr i128, ptr %12, i64 %88
  %90 = load i128, ptr %89, align 8, !tbaa !7
  %91 = sdiv i128 %3, %90
  %92 = add i64 %77, %86
  %93 = getelementptr i128, ptr %73, i64 %92
  store i128 %91, ptr %93, align 8, !tbaa !7
  %94 = add nuw nsw i64 %86, 2
  %95 = sub i64 %34, %87
  %96 = getelementptr i128, ptr %12, i64 %95
  %97 = load i128, ptr %96, align 8, !tbaa !7
  %98 = sdiv i128 %3, %97
  %99 = add i64 %77, %87
  %100 = getelementptr i128, ptr %73, i64 %99
  store i128 %98, ptr %100, align 8, !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 %.preheader121.loopexit.unr-lcssa, label %85

._crit_edge133.sink.split:                        ; preds = %.preheader121, %.preheader
  %.sink147 = phi ptr [ %43, %.preheader ], [ %73, %.preheader121 ]
  %.2.off0.ph = phi i64 [ %41, %.preheader ], [ %39, %.preheader121 ]
  %101 = or i64 %10, 1
  %smin143 = tail call i64 @llvm.smin.i64(i64 %10, i64 1)
  %102 = sub nuw nsw i64 %101, %smin143
  %103 = shl nuw nsw i64 %102, 4
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %12, ptr align 8 %.sink147, i64 %103, i1 false), !tbaa !7
  br label %._crit_edge133

._crit_edge133:                                   ; preds = %._crit_edge133.sink.split, %.preheader121, %.preheader
  %.sink = phi ptr [ %43, %.preheader ], [ %73, %.preheader121 ], [ %.sink147, %._crit_edge133.sink.split ]
  %.2.off0 = phi i64 [ %41, %.preheader ], [ %39, %.preheader121 ], [ %.2.off0.ph, %._crit_edge133.sink.split ]
  tail call void @free(ptr %.sink)
  %104 = tail call i64 @llvm.smax.i64(i64 %.2.off0, i64 0)
  %105 = shl i64 %104, 4
  %106 = tail call ptr @malloc(i64 %105)
  store ptr %106, ptr %0, align 8, !tbaa !3
  store i64 16, ptr %.repack90, align 8, !tbaa !3
  store i32 20180515, ptr %.repack91, align 8, !tbaa !3
  store i8 1, ptr %.repack92, align 4, !tbaa !3
  store i8 11, ptr %.repack93, align 1, !tbaa !3
  store i8 2, ptr %.repack94, align 2, !tbaa !3
  store i8 0, ptr %.repack95, align 1, !tbaa !3
  store i64 1, ptr %.repack96, align 8, !tbaa !3
  store i64 %104, ptr %.repack96.repack97, align 8, !tbaa !3
  store i64 16, ptr %.repack96.repack98, align 8, !tbaa !3
  %.not139 = icmp slt i64 %.2.off0, 1
  br i1 %.not139, label %._crit_edge136, label %.lr.ph135.preheader

.lr.ph135.preheader:                              ; preds = %._crit_edge133
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %106, ptr nonnull align 8 %12, i64 %105, i1 false), !tbaa !7
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %.lr.ph135.preheader, %._crit_edge133
  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 i128, align 8
  %5 = alloca i128, align 8
  %6 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.64e48d2bc2f38e3c8a95f4cc5912bf42, i32 51)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %5, i32 16)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = load i128, ptr %5, align 8, !tbaa !7
  %10 = add i128 %9, -1
  store i128 %10, ptr %4, align 8, !tbaa !7
  call void @_QMdivisormodPalldivisor(ptr nonnull %3, ptr nonnull %4)
  %.fca.0.load = load ptr, ptr %3, align 8, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.0.load = load i64, 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 %3, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.1.load = load i64, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %11 = icmp eq i64 %.fca.7.0.1.load, 0
  %12 = select i1 %11, i64 1, i64 %.fca.7.0.0.load
  store ptr %.fca.0.load, ptr %1, align 8, !tbaa !3
  %.fca.1.gep104 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 16, ptr %.fca.1.gep104, align 8, !tbaa !3
  %.fca.2.gep105 = 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.gep105, align 8, !tbaa !3
  %.fca.3.gep106 = 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.gep106, align 4, !tbaa !3
  %.fca.4.gep107 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 11, ptr %.fca.4.gep107, align 1, !tbaa !3
  %.fca.5.gep108 = 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.gep108, align 2, !tbaa !3
  %.fca.6.gep109 = 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.gep109, align 1, !tbaa !3
  %.fca.7.0.0.gep110 = 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 %12, ptr %.fca.7.0.0.gep110, align 8, !tbaa !3
  %.fca.7.0.1.gep111 = 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 %.fca.7.0.1.load, ptr %.fca.7.0.1.gep111, align 8, !tbaa !3
  %.fca.7.0.2.gep112 = 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 16, ptr %.fca.7.0.2.gep112, align 8, !tbaa !3
  %13 = call i64 @_FortranASize(ptr nonnull %1, ptr nonnull @_QQcl.64e48d2bc2f38e3c8a95f4cc5912bf42, i32 54)
  %14 = trunc i64 %13 to i32
  %15 = sext i32 %14 to i128
  %.not = icmp eq ptr %.fca.0.load, null
  br i1 %.not, label %17, label %16

16:                                               ; preds = %0
  call void @free(ptr nonnull %.fca.0.load)
  br label %17

17:                                               ; preds = %16, %0
  %18 = add nsw i128 %15, -1
  call void @_QMdivisormodPalldivisor(ptr nonnull %2, ptr nonnull %5)
  %.fca.0.load42 = load ptr, ptr %2, align 8, !tbaa !3
  %.fca.7.0.1.gep65 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.1.load66 = load i64, ptr %.fca.7.0.1.gep65, align 8, !tbaa !3
  %.unpack = load ptr, ptr @_QFEdivisor.0, align 8, !tbaa !3
  %.not365 = icmp eq ptr %.unpack, null
  br i1 %.not365, label %61, label %19

19:                                               ; preds = %17
  %.unpack360.unpack.unpack362 = load i64, ptr @_QFEdivisor.8, align 8, !tbaa !3
  %.not401 = icmp eq i64 %.unpack360.unpack.unpack362, %.fca.7.0.1.load66
  br i1 %.not401, label %.preheader, label %22

.preheader:                                       ; preds = %19
  %20 = icmp sgt i64 %.fca.7.0.1.load66, 0
  br i1 %20, label %.lr.ph404.preheader, label %._crit_edge

.lr.ph404.preheader:                              ; preds = %.preheader
  %xtraiter428 = and i64 %.fca.7.0.1.load66, 3
  %21 = icmp ult i64 %.fca.7.0.1.load66, 4
  br i1 %21, label %._crit_edge.thread.loopexit.unr-lcssa, label %.lr.ph404.preheader.new

.lr.ph404.preheader.new:                          ; preds = %.lr.ph404.preheader
  %unroll_iter432 = and i64 %.fca.7.0.1.load66, -4
  br label %.lr.ph404

22:                                               ; preds = %19
  %23 = shl i64 %.fca.7.0.1.load66, 4
  %24 = call ptr @malloc(i64 %23)
  %25 = icmp sgt i64 %.fca.7.0.1.load66, 0
  br i1 %25, label %.lr.ph.preheader, label %.thread400

.lr.ph.preheader:                                 ; preds = %22
  %xtraiter = and i64 %.fca.7.0.1.load66, 3
  %26 = icmp ult i64 %.fca.7.0.1.load66, 4
  br i1 %26, label %.loopexit402.loopexit427.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %.fca.7.0.1.load66, -4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %27 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %42, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %28 = getelementptr i128, ptr %.fca.0.load42, i64 %27
  %29 = load i128, ptr %28, align 8, !tbaa !7
  %30 = or i64 %27, 1
  %31 = getelementptr i128, ptr %24, i64 %27
  store i128 %29, ptr %31, align 8, !tbaa !7
  %32 = getelementptr i128, ptr %.fca.0.load42, i64 %30
  %33 = load i128, ptr %32, align 8, !tbaa !7
  %34 = or i64 %27, 2
  %35 = getelementptr i128, ptr %24, i64 %30
  store i128 %33, ptr %35, align 8, !tbaa !7
  %36 = getelementptr i128, ptr %.fca.0.load42, i64 %34
  %37 = load i128, ptr %36, align 8, !tbaa !7
  %38 = or i64 %27, 3
  %39 = getelementptr i128, ptr %24, i64 %34
  store i128 %37, ptr %39, align 8, !tbaa !7
  %40 = getelementptr i128, ptr %.fca.0.load42, i64 %38
  %41 = load i128, ptr %40, align 8, !tbaa !7
  %42 = add nuw nsw i64 %27, 4
  %43 = getelementptr i128, ptr %24, i64 %38
  store i128 %41, ptr %43, align 8, !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 %.loopexit402.loopexit427.unr-lcssa, label %.lr.ph

.lr.ph404:                                        ; preds = %.lr.ph404, %.lr.ph404.preheader.new
  %44 = phi i64 [ 0, %.lr.ph404.preheader.new ], [ %59, %.lr.ph404 ]
  %niter433 = phi i64 [ 0, %.lr.ph404.preheader.new ], [ %niter433.next.3, %.lr.ph404 ]
  %45 = getelementptr i128, ptr %.fca.0.load42, i64 %44
  %46 = load i128, ptr %45, align 8, !tbaa !7
  %47 = or i64 %44, 1
  %48 = getelementptr i128, ptr %.unpack, i64 %44
  store i128 %46, ptr %48, align 8, !tbaa !7
  %49 = getelementptr i128, ptr %.fca.0.load42, i64 %47
  %50 = load i128, ptr %49, align 8, !tbaa !7
  %51 = or i64 %44, 2
  %52 = getelementptr i128, ptr %.unpack, i64 %47
  store i128 %50, ptr %52, align 8, !tbaa !7
  %53 = getelementptr i128, ptr %.fca.0.load42, i64 %51
  %54 = load i128, ptr %53, align 8, !tbaa !7
  %55 = or i64 %44, 3
  %56 = getelementptr i128, ptr %.unpack, i64 %51
  store i128 %54, ptr %56, align 8, !tbaa !7
  %57 = getelementptr i128, ptr %.fca.0.load42, i64 %55
  %58 = load i128, ptr %57, align 8, !tbaa !7
  %59 = add nuw nsw i64 %44, 4
  %60 = getelementptr i128, ptr %.unpack, i64 %55
  store i128 %58, ptr %60, align 8, !tbaa !7
  %niter433.next.3 = add i64 %niter433, 4
  %niter433.ncmp.3 = icmp eq i64 %niter433.next.3, %unroll_iter432
  br i1 %niter433.ncmp.3, label %._crit_edge.thread.loopexit.unr-lcssa, label %.lr.ph404

61:                                               ; preds = %17
  %62 = shl i64 %.fca.7.0.1.load66, 4
  %63 = call ptr @malloc(i64 %62)
  %64 = icmp sgt i64 %.fca.7.0.1.load66, 0
  br i1 %64, label %.lr.ph406.preheader, label %.loopexit402.thread

.lr.ph406.preheader:                              ; preds = %61
  %xtraiter434 = and i64 %.fca.7.0.1.load66, 3
  %65 = icmp ult i64 %.fca.7.0.1.load66, 4
  br i1 %65, label %.loopexit402.loopexit.unr-lcssa, label %.lr.ph406.preheader.new

.lr.ph406.preheader.new:                          ; preds = %.lr.ph406.preheader
  %unroll_iter438 = and i64 %.fca.7.0.1.load66, -4
  br label %.lr.ph406

.lr.ph406:                                        ; preds = %.lr.ph406, %.lr.ph406.preheader.new
  %66 = phi i64 [ 0, %.lr.ph406.preheader.new ], [ %81, %.lr.ph406 ]
  %niter439 = phi i64 [ 0, %.lr.ph406.preheader.new ], [ %niter439.next.3, %.lr.ph406 ]
  %67 = getelementptr i128, ptr %.fca.0.load42, i64 %66
  %68 = load i128, ptr %67, align 8, !tbaa !7
  %69 = or i64 %66, 1
  %70 = getelementptr i128, ptr %63, i64 %66
  store i128 %68, ptr %70, align 8, !tbaa !7
  %71 = getelementptr i128, ptr %.fca.0.load42, i64 %69
  %72 = load i128, ptr %71, align 8, !tbaa !7
  %73 = or i64 %66, 2
  %74 = getelementptr i128, ptr %63, i64 %69
  store i128 %72, ptr %74, align 8, !tbaa !7
  %75 = getelementptr i128, ptr %.fca.0.load42, i64 %73
  %76 = load i128, ptr %75, align 8, !tbaa !7
  %77 = or i64 %66, 3
  %78 = getelementptr i128, ptr %63, i64 %73
  store i128 %76, ptr %78, align 8, !tbaa !7
  %79 = getelementptr i128, ptr %.fca.0.load42, i64 %77
  %80 = load i128, ptr %79, align 8, !tbaa !7
  %81 = add nuw nsw i64 %66, 4
  %82 = getelementptr i128, ptr %63, i64 %77
  store i128 %80, ptr %82, align 8, !tbaa !7
  %niter439.next.3 = add i64 %niter439, 4
  %niter439.ncmp.3 = icmp eq i64 %niter439.next.3, %unroll_iter438
  br i1 %niter439.ncmp.3, label %.loopexit402.loopexit.unr-lcssa, label %.lr.ph406

.loopexit402.loopexit.unr-lcssa:                  ; preds = %.lr.ph406, %.lr.ph406.preheader
  %.unr436 = phi i64 [ 0, %.lr.ph406.preheader ], [ %81, %.lr.ph406 ]
  %lcmp.mod437.not = icmp eq i64 %xtraiter434, 0
  br i1 %lcmp.mod437.not, label %.loopexit402, label %.lr.ph406.epil

.lr.ph406.epil:                                   ; preds = %.loopexit402.loopexit.unr-lcssa, %.lr.ph406.epil
  %83 = phi i64 [ %86, %.lr.ph406.epil ], [ %.unr436, %.loopexit402.loopexit.unr-lcssa ]
  %epil.iter435 = phi i64 [ %epil.iter435.next, %.lr.ph406.epil ], [ 0, %.loopexit402.loopexit.unr-lcssa ]
  %84 = getelementptr i128, ptr %.fca.0.load42, i64 %83
  %85 = load i128, ptr %84, align 8, !tbaa !7
  %86 = add nuw nsw i64 %83, 1
  %87 = getelementptr i128, ptr %63, i64 %83
  store i128 %85, ptr %87, align 8, !tbaa !7
  %epil.iter435.next = add i64 %epil.iter435, 1
  %epil.iter435.cmp.not = icmp eq i64 %epil.iter435.next, %xtraiter434
  br i1 %epil.iter435.cmp.not, label %.loopexit402, label %.lr.ph406.epil, !llvm.loop !9

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

.lr.ph.epil:                                      ; preds = %.loopexit402.loopexit427.unr-lcssa, %.lr.ph.epil
  %88 = phi i64 [ %91, %.lr.ph.epil ], [ %.unr, %.loopexit402.loopexit427.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.loopexit402.loopexit427.unr-lcssa ]
  %89 = getelementptr i128, ptr %.fca.0.load42, i64 %88
  %90 = load i128, ptr %89, align 8, !tbaa !7
  %91 = add nuw nsw i64 %88, 1
  %92 = getelementptr i128, ptr %24, i64 %88
  store i128 %90, ptr %92, align 8, !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 %.loopexit402, label %.lr.ph.epil, !llvm.loop !11

.loopexit402:                                     ; preds = %.loopexit402.loopexit427.unr-lcssa, %.lr.ph.epil, %.loopexit402.loopexit.unr-lcssa, %.lr.ph406.epil
  %.ph = phi ptr [ %63, %.lr.ph406.epil ], [ %63, %.loopexit402.loopexit.unr-lcssa ], [ %24, %.lr.ph.epil ], [ %24, %.loopexit402.loopexit427.unr-lcssa ]
  br i1 %.not365, label %.loopexit402.thread, label %.thread400

.thread400:                                       ; preds = %22, %.loopexit402
  %.ph423 = phi ptr [ %.ph, %.loopexit402 ], [ %24, %22 ]
  call void @free(ptr nonnull %.unpack)
  br label %.loopexit402.thread

.loopexit402.thread:                              ; preds = %61, %.thread400, %.loopexit402
  %.ph420 = phi ptr [ %.ph423, %.thread400 ], [ %.ph, %.loopexit402 ], [ %63, %61 ]
  store ptr %.ph420, ptr @_QFEdivisor.0, align 8, !tbaa !3
  store i64 %.fca.7.0.1.load66, ptr @_QFEdivisor.8, align 8, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader, %.loopexit402.thread
  %.not366 = icmp eq ptr %.fca.0.load42, null
  br i1 %.not366, label %98, label %._crit_edge.thread

._crit_edge.thread.loopexit.unr-lcssa:            ; preds = %.lr.ph404, %.lr.ph404.preheader
  %.unr430 = phi i64 [ 0, %.lr.ph404.preheader ], [ %59, %.lr.ph404 ]
  %lcmp.mod431.not = icmp eq i64 %xtraiter428, 0
  br i1 %lcmp.mod431.not, label %._crit_edge.thread, label %.lr.ph404.epil

.lr.ph404.epil:                                   ; preds = %._crit_edge.thread.loopexit.unr-lcssa, %.lr.ph404.epil
  %93 = phi i64 [ %96, %.lr.ph404.epil ], [ %.unr430, %._crit_edge.thread.loopexit.unr-lcssa ]
  %epil.iter429 = phi i64 [ %epil.iter429.next, %.lr.ph404.epil ], [ 0, %._crit_edge.thread.loopexit.unr-lcssa ]
  %94 = getelementptr i128, ptr %.fca.0.load42, i64 %93
  %95 = load i128, ptr %94, align 8, !tbaa !7
  %96 = add nuw nsw i64 %93, 1
  %97 = getelementptr i128, ptr %.unpack, i64 %93
  store i128 %95, ptr %97, align 8, !tbaa !7
  %epil.iter429.next = add i64 %epil.iter429, 1
  %epil.iter429.cmp.not = icmp eq i64 %epil.iter429.next, %xtraiter428
  br i1 %epil.iter429.cmp.not, label %._crit_edge.thread, label %.lr.ph404.epil, !llvm.loop !12

._crit_edge.thread:                               ; preds = %._crit_edge.thread.loopexit.unr-lcssa, %.lr.ph404.epil, %._crit_edge
  call void @free(ptr nonnull %.fca.0.load42)
  %.unpack374.unpack.unpack376.pre = load i64, ptr @_QFEdivisor.8, align 8, !tbaa !3
  br label %98

98:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %.unpack374.unpack.unpack376 = phi i64 [ %.unpack374.unpack.unpack376.pre, %._crit_edge.thread ], [ %.fca.7.0.1.load66, %._crit_edge ]
  %99 = trunc i64 %.unpack374.unpack.unpack376 to i32
  %100 = icmp sgt i32 %99, 1
  br i1 %100, label %.lr.ph412, label %._crit_edge413

.lr.ph412:                                        ; preds = %98
  %.mask = and i64 %.unpack374.unpack.unpack376, 4294967295
  %101 = zext i64 %.mask to i128
  %102 = load i128, ptr %5, align 8, !tbaa !7
  %.unpack379 = load ptr, ptr @_QFEdivisor.0, align 8, !tbaa !3
  br label %103

103:                                              ; preds = %.lr.ph412, %.loopexit
  %.0410.in = phi i128 [ %101, %.lr.ph412 ], [ %.0410, %.loopexit ]
  %.0348409 = phi i64 [ 2, %.lr.ph412 ], [ %112, %.loopexit ]
  %.0349408 = phi i128 [ %18, %.lr.ph412 ], [ %.1, %.loopexit ]
  %.0410 = add nsw i128 %.0410.in, -1
  %104 = add nsw i64 %.0348409, -1
  %105 = getelementptr i128, ptr %.unpack379, i64 %104
  %106 = load i128, ptr %105, align 8, !tbaa !7
  br label %107

107:                                              ; preds = %107, %103
  %.0347 = phi i128 [ %102, %103 ], [ %108, %107 ]
  %.0347.frozen = freeze i128 %.0347
  %.frozen = freeze i128 %106
  %108 = sdiv i128 %.0347.frozen, %.frozen
  %109 = mul i128 %108, %.frozen
  %.decomposed = sub i128 %.0347.frozen, %109
  switch i128 %.decomposed, label %.loopexit [
    i128 0, label %107
    i128 1, label %110
  ]

110:                                              ; preds = %107
  %111 = add i128 %.0349408, 1
  br label %.loopexit

.loopexit:                                        ; preds = %107, %110
  %.1 = phi i128 [ %111, %110 ], [ %.0349408, %107 ]
  %112 = add nuw nsw i64 %.0348409, 1
  %113 = icmp sgt i128 %.0410.in, 2
  br i1 %113, label %103, label %._crit_edge413

._crit_edge413:                                   ; preds = %.loopexit, %98
  %.0349.lcssa = phi i128 [ %18, %98 ], [ %.1, %.loopexit ]
  %114 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.64e48d2bc2f38e3c8a95f4cc5912bf42, i32 77)
  %115 = call i1 @_FortranAioOutputInteger128(ptr %114, i128 %.0349.lcssa)
  %116 = call i32 @_FortranAioEndIoStatement(ptr %114)
  ret void
}

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 i64 @_FortranASize(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger128(ptr, i128) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.sqrt.f32(float) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.floor.f32(float) #3

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

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

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

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

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 = { nounwind }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
