module mod_binary_indexed_tree
  implicit none
  type fenwick_tree
    integer :: n
    integer, pointer :: arr(:)
  end type fenwick_tree
  private
  public :: fenwick_tree, init_bit, release_bit
  public :: add, summate, update, maximum
contains
  subroutine init_bit(bit,n)
    implicit none
    type(fenwick_tree) :: bit
    integer, intent(in) :: n
    bit%n = n
    allocate(bit%arr(n))
    bit%arr = 0
    return
  end subroutine init_bit
  subroutine release_bit(bit)
    implicit none
    type(fenwick_tree) :: bit
    if (associated(bit%arr)) deallocate(bit%arr)
    return
  end subroutine release_bit
  subroutine add(bit,i,v)
    implicit none
    type(fenwick_tree) :: bit
    integer, intent(in) :: i, v
    integer :: x
    if (i.eq.0) return
    x = i
    do while (x.le.bit%n)
      bit%arr(x) = bit%arr(x)+v
      x = x+and(x,-x)
    end do
    return
  end subroutine add
  function summate(bit,i) result(s)
    implicit none
    type(fenwick_tree) :: bit
    integer, intent(in) :: i
    integer :: x, s
    x = i
    s = 0
    do while (x.gt.0)
      s = s+bit%arr(x)
      x = x-and(x,-x)
    end do
    return
  end function summate
  subroutine update(bit,i,v)
    implicit none
    type(fenwick_tree) :: bit
    integer, intent(in) :: i, v
    integer :: x
    x = i
    do while (x.le.bit%n)
      if (bit%arr(x).lt.v) bit%arr(x) = v
      x = x+and(x,-x)
    end do
    return
  end subroutine update
  function maximum(bit,i) result(m)
    implicit none
    type(fenwick_tree) :: bit
    integer, intent(in) :: i
    integer :: x, m
    x = i
    m = 0
    do while (x.gt.0)
      m = max(m,bit%arr(x))
      x = x-and(x,-x)
    end do
    return
  end function maximum
end module mod_binary_indexed_tree
program sorted_and_sorted
  use mod_binary_indexed_tree
  implicit none
  integer, parameter :: infty = 1000000000
  type(fenwick_tree) :: bit
  integer :: n, a, aw, ab, i, j
  integer :: ib(2000), iw(2000), dp(0:2000,0:2000)
  character(1) :: c
  ib = 0
  iw = 0
  dp = infty
  dp(0,0) = 0
  read(*,*) n
  call init_bit(bit,2*n)
  do i = 1, 2*n
    read(*,*) c, a
    if (c.eq."B") then
      ib(a) = i
    else
      iw(a) = i
    end if
  end do
  do i = 0, n
    if (i.ne.0) then
      call add(bit,1,1)
      call add(bit,ib(i),-1)
    end if
    do j = 0, n
      if (j.ne.0) then
        call add(bit,1,1)
        call add(bit,iw(j),-1)
      end if
      if (i.ne.0) dp(i,j) = min(dp(i,j),dp(i-1,j)+ib(i)-i-j+summate(bit,ib(i)))
      if (j.ne.0) dp(i,j) = min(dp(i,j),dp(i,j-1)+iw(j)-i-j+summate(bit,iw(j)))
    end do
    do j = n, 1, -1
      call add(bit,1,-1)
      call add(bit,iw(j),1)
    end do
  end do
  write(*,'(i0)') dp(n,n)
  call release_bit(bit)
  stop
end program sorted_and_sorted
; 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"

%_QMmod_binary_indexed_treeTfenwick_tree = type { i32, { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } }

@_QQcl.d5de655624804eee6af32ac6fad82c66 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5999/source.f\00"
@_QFEbit = internal global %_QMmod_binary_indexed_treeTfenwick_tree undef
@_QFEdp = internal unnamed_addr global [2001 x [2001 x i32]] undef
@_QFEib = internal unnamed_addr global [2000 x i32] undef
@_QFEiw = internal unnamed_addr global [2000 x i32] undef
@_QQcl.42 = linkonce constant [1 x i8] c"B"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind memory(write, argmem: readwrite, inaccessiblemem: readwrite)
define void @_QMmod_binary_indexed_treePinit_bit(ptr nocapture writeonly %0, ptr nocapture readonly %1) local_unnamed_addr #2 {
  %3 = load i32, ptr %1, align 4, !tbaa !3
  store i32 %3, ptr %0, align 4, !tbaa !3
  %4 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = tail call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = shl nuw nsw i64 %7, 2
  %9 = tail call ptr @malloc(i64 %8)
  store ptr %9, ptr %4, align 8, !tbaa !7
  %.repack29 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 1
  store i64 4, ptr %.repack29, align 8, !tbaa !7
  %.repack31 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 2
  store i32 20180515, ptr %.repack31, align 8, !tbaa !7
  %.repack33 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 3
  store i8 1, ptr %.repack33, align 4, !tbaa !7
  %.repack35 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 4
  store i8 9, ptr %.repack35, align 1, !tbaa !7
  %.repack37 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 5
  store i8 1, ptr %.repack37, align 2, !tbaa !7
  %.repack39 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 6
  store i8 0, ptr %.repack39, align 1, !tbaa !7
  %.repack41 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  store i64 1, ptr %.repack41, align 8, !tbaa !7
  %.repack41.repack43 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 1
  store i64 %7, ptr %.repack41.repack43, align 8, !tbaa !7
  %.repack41.repack45 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  store i64 4, ptr %.repack41.repack45, align 8, !tbaa !7
  %.not = icmp slt i32 %5, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %10 = tail call i64 @llvm.smax.i64(i64 %7, i64 1)
  %11 = shl nuw nsw i64 %10, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %9, i8 0, i64 %11, i1 false), !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %2
  ret void
}

; Function Attrs: mustprogress nounwind willreturn
define void @_QMmod_binary_indexed_treePrelease_bit(ptr nocapture %0) local_unnamed_addr #3 {
  %2 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %.unpack = load ptr, ptr %2, align 8, !tbaa !7
  %.not = icmp eq ptr %.unpack, null
  br i1 %.not, label %4, label %3

3:                                                ; preds = %1
  tail call void @free(ptr nonnull %.unpack)
  store ptr null, ptr %2, align 8, !tbaa !7
  %.repack57 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 1
  store i64 4, ptr %.repack57, align 8, !tbaa !7
  %.repack58 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 2
  store i32 20180515, ptr %.repack58, align 8, !tbaa !7
  %.repack59 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 3
  store i8 1, ptr %.repack59, align 4, !tbaa !7
  %.repack60 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 4
  store i8 9, ptr %.repack60, align 1, !tbaa !7
  %.repack61 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 5
  store i8 1, ptr %.repack61, align 2, !tbaa !7
  %.repack62 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 6
  store i8 0, ptr %.repack62, align 1, !tbaa !7
  %.repack63 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  store i64 1, ptr %.repack63, align 8, !tbaa !7
  %.repack63.repack64 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 1
  store i64 0, ptr %.repack63.repack64, align 8, !tbaa !7
  %.repack63.repack65 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  store i64 4, ptr %.repack63.repack65, align 8, !tbaa !7
  br label %4

4:                                                ; preds = %3, %1
  ret void
}

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QMmod_binary_indexed_treePadd(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #4 {
  %4 = load i32, ptr %1, align 4, !tbaa !3
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %3
  %6 = load i32, ptr %0, align 4, !tbaa !3
  %.not25 = icmp sgt i32 %4, %6
  br i1 %.not25, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %7 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %.unpack = load ptr, ptr %7, align 8, !tbaa !7
  %.elt17 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  %.unpack18.unpack.unpack = load i64, ptr %.elt17, align 8, !tbaa !7
  %.unpack18.unpack.elt22 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  %.unpack18.unpack.unpack23 = load i64, ptr %.unpack18.unpack.elt22, align 8, !tbaa !7
  br label %8

8:                                                ; preds = %.lr.ph, %8
  %.026 = phi i32 [ %4, %.lr.ph ], [ %18, %8 ]
  %9 = sext i32 %.026 to i64
  %10 = sub i64 %9, %.unpack18.unpack.unpack
  %11 = mul i64 %10, %.unpack18.unpack.unpack23
  %12 = getelementptr i8, ptr %.unpack, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !3
  %14 = load i32, ptr %2, align 4, !tbaa !3
  %15 = add i32 %14, %13
  store i32 %15, ptr %12, align 4, !tbaa !3
  %16 = sub i32 0, %.026
  %17 = and i32 %.026, %16
  %18 = add i32 %17, %.026
  %19 = load i32, ptr %0, align 4, !tbaa !3
  %.not = icmp sgt i32 %18, %19
  br i1 %.not, label %.loopexit, label %8

.loopexit:                                        ; preds = %8, %.preheader, %3
  ret void
}

; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none)
define i32 @_QMmod_binary_indexed_treePsummate(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #5 {
  %3 = load i32, ptr %1, align 4, !tbaa !3
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %5 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %.unpack = load ptr, ptr %5, align 8, !tbaa !7
  %.elt19 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  %.unpack20.unpack.unpack = load i64, ptr %.elt19, align 8, !tbaa !7
  %.unpack20.unpack.elt24 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  %.unpack20.unpack.unpack25 = load i64, ptr %.unpack20.unpack.elt24, align 8, !tbaa !7
  br label %6

6:                                                ; preds = %.lr.ph, %6
  %.028 = phi i32 [ %3, %.lr.ph ], [ %13, %6 ]
  %.0627 = phi i32 [ 0, %.lr.ph ], [ %12, %6 ]
  %7 = zext i32 %.028 to i64
  %8 = sub i64 %7, %.unpack20.unpack.unpack
  %9 = mul i64 %8, %.unpack20.unpack.unpack25
  %10 = getelementptr i8, ptr %.unpack, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !3
  %12 = add i32 %11, %.0627
  %.not = add nsw i32 %.028, -1
  %13 = and i32 %.not, %.028
  %.not29 = icmp eq i32 %13, 0
  br i1 %.not29, label %._crit_edge, label %6

._crit_edge:                                      ; preds = %6, %2
  %.06.lcssa = phi i32 [ 0, %2 ], [ %12, %6 ]
  ret i32 %.06.lcssa
}

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QMmod_binary_indexed_treePupdate(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #4 {
  %4 = load i32, ptr %1, align 4, !tbaa !3
  %5 = load i32, ptr %0, align 4, !tbaa !3
  %.not47 = icmp sgt i32 %4, %5
  br i1 %.not47, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %6 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %.unpack = load ptr, ptr %6, align 8, !tbaa !7
  %.elt39 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  %.unpack40.unpack.unpack = load i64, ptr %.elt39, align 8, !tbaa !7
  %.unpack40.unpack.elt44 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  %.unpack40.unpack.unpack45 = load i64, ptr %.unpack40.unpack.elt44, align 8, !tbaa !7
  %.pre49 = load i32, ptr %2, align 4, !tbaa !3
  br label %7

7:                                                ; preds = %.lr.ph, %17
  %8 = phi i32 [ %5, %.lr.ph ], [ %18, %17 ]
  %9 = phi i32 [ %.pre49, %.lr.ph ], [ %19, %17 ]
  %.048 = phi i32 [ %4, %.lr.ph ], [ %22, %17 ]
  %10 = sext i32 %.048 to i64
  %11 = sub i64 %10, %.unpack40.unpack.unpack
  %12 = mul i64 %11, %.unpack40.unpack.unpack45
  %13 = getelementptr i8, ptr %.unpack, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !3
  %15 = icmp slt i32 %14, %9
  br i1 %15, label %16, label %17

16:                                               ; preds = %7
  store i32 %9, ptr %13, align 4, !tbaa !3
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  %.pre50 = load i32, ptr %0, align 4, !tbaa !3
  br label %17

17:                                               ; preds = %16, %7
  %18 = phi i32 [ %.pre50, %16 ], [ %8, %7 ]
  %19 = phi i32 [ %.pre, %16 ], [ %9, %7 ]
  %20 = sub i32 0, %.048
  %21 = and i32 %.048, %20
  %22 = add i32 %21, %.048
  %.not = icmp sgt i32 %22, %18
  br i1 %.not, label %._crit_edge, label %7

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

; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none)
define i32 @_QMmod_binary_indexed_treePmaximum(ptr nocapture readonly %0, ptr nocapture readonly %1) local_unnamed_addr #6 {
  %3 = load i32, ptr %1, align 4, !tbaa !3
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %5 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1
  %.unpack = load ptr, ptr %5, align 8, !tbaa !7
  %.elt19 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7
  %.unpack20.unpack.unpack = load i64, ptr %.elt19, align 8, !tbaa !7
  %.unpack20.unpack.elt24 = getelementptr %_QMmod_binary_indexed_treeTfenwick_tree, ptr %0, i64 0, i32 1, i32 7, i64 0, i64 2
  %.unpack20.unpack.unpack25 = load i64, ptr %.unpack20.unpack.elt24, align 8, !tbaa !7
  br label %6

6:                                                ; preds = %.lr.ph, %6
  %.028 = phi i32 [ %3, %.lr.ph ], [ %13, %6 ]
  %.0627 = phi i32 [ 0, %.lr.ph ], [ %12, %6 ]
  %7 = zext i32 %.028 to i64
  %8 = sub i64 %7, %.unpack20.unpack.unpack
  %9 = mul i64 %8, %.unpack20.unpack.unpack25
  %10 = getelementptr i8, ptr %.unpack, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !3
  %12 = tail call i32 @llvm.smax.i32(i32 %.0627, i32 %11)
  %.not = add nsw i32 %.028, -1
  %13 = and i32 %.not, %.028
  %.not29 = icmp eq i32 %13, 0
  br i1 %.not29, label %._crit_edge, label %6

._crit_edge:                                      ; preds = %6, %2
  %.06.lcssa = phi i32 [ 0, %2 ], [ %12, %6 ]
  ret i32 %.06.lcssa
}

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #7 {
.preheader106.preheader:
  %0 = alloca i32, align 4
  %1 = alloca [1 x i8], align 1
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @_QFEib, i8 0, i64 8000, i1 false), !tbaa !3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @_QFEiw, i8 0, i64 8000, i1 false), !tbaa !3
  br label %.preheader

.preheader:                                       ; preds = %.preheader106.preheader, %scalar.ph
  %3 = phi i64 [ %14, %scalar.ph ], [ 0, %.preheader106.preheader ]
  %4 = mul nuw nsw i64 %3, 2001
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %.preheader
  %index = phi i64 [ 0, %.preheader ], [ %index.next.1, %vector.body ]
  %5 = add nuw nsw i64 %index, %4
  %6 = getelementptr i32, ptr @_QFEdp, i64 %5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %6, align 4, !tbaa !3
  %7 = getelementptr i32, ptr %6, i64 4
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %7, align 4, !tbaa !3
  %index.next = or i64 %index, 8
  %8 = add nuw nsw i64 %index.next, %4
  %9 = getelementptr i32, ptr @_QFEdp, i64 %8
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %9, align 4, !tbaa !3
  %10 = getelementptr i32, ptr %9, i64 4
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %10, align 4, !tbaa !3
  %index.next.1 = add nuw nsw i64 %index, 16
  %11 = icmp eq i64 %index.next.1, 2000
  br i1 %11, label %scalar.ph, label %vector.body, !llvm.loop !9

scalar.ph:                                        ; preds = %vector.body
  %12 = add nuw nsw i64 %4, 2000
  %13 = getelementptr i32, ptr @_QFEdp, i64 %12
  store i32 1000000000, ptr %13, align 4, !tbaa !3
  %14 = add nuw nsw i64 %3, 1
  %exitcond117.not = icmp eq i64 %14, 2001
  br i1 %exitcond117.not, label %15, label %.preheader

15:                                               ; preds = %scalar.ph
  store i32 0, ptr @_QFEdp, align 16, !tbaa !3
  %16 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d5de655624804eee6af32ac6fad82c66, i32 90)
  %17 = call i1 @_FortranAioInputInteger(ptr %16, ptr nonnull %2, i32 4)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %16)
  %19 = load i32, ptr %2, align 4, !tbaa !3
  %20 = shl i32 %19, 1
  store i32 %20, ptr @_QFEbit, align 16, !tbaa !3
  %21 = call i32 @llvm.smax.i32(i32 %20, i32 0)
  %22 = zext i32 %21 to i64
  %23 = shl nuw nsw i64 %22, 2
  %24 = call ptr @malloc(i64 %23)
  store ptr %24, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1), align 8, !tbaa !7
  store i64 4, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 1), align 16, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 2), align 8, !tbaa !7
  store i8 1, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 3), align 4, !tbaa !7
  store i8 9, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 4), align 1, !tbaa !7
  store i8 1, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 6), align 1, !tbaa !7
  store i64 1, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7), align 16, !tbaa !7
  store i64 %22, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7, i64 0, i64 1), align 8, !tbaa !7
  store i64 4, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7, i64 0, i64 2), align 16, !tbaa !7
  %.not.i = icmp slt i32 %20, 1
  br i1 %.not.i, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %15
  %25 = call i64 @llvm.smax.i64(i64 %22, i64 1)
  %26 = shl nuw nsw i64 %25, 2
  call void @llvm.memset.p0.i64(ptr align 4 %24, i8 0, i64 %26, i1 false), !tbaa !3
  %27 = zext i32 %20 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %28 = phi i64 [ %41, %.lr.ph ], [ %27, %.lr.ph.preheader ]
  %29 = phi i32 [ %40, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %30 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d5de655624804eee6af32ac6fad82c66, i32 93)
  %31 = call i1 @_FortranAioInputAscii(ptr %30, ptr nonnull %1, i64 1)
  %32 = call i1 @_FortranAioInputInteger(ptr %30, ptr nonnull %0, i32 4)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %30)
  %34 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %1, ptr nonnull @_QQcl.42, i64 1, i64 1)
  %35 = icmp eq i32 %34, 0
  %36 = load i32, ptr %0, align 4, !tbaa !3
  %37 = sext i32 %36 to i64
  %38 = add nsw i64 %37, -1
  %_QFEib._QFEiw = select i1 %35, ptr @_QFEib, ptr @_QFEiw
  %39 = getelementptr [2000 x i32], ptr %_QFEib._QFEiw, i64 0, i64 %38
  store i32 %29, ptr %39, align 4, !tbaa !3
  %40 = add nuw nsw i32 %29, 1
  %41 = add nsw i64 %28, -1
  %42 = icmp sgt i64 %28, 1
  br i1 %42, label %.lr.ph, label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %15, %._crit_edge.loopexit
  %43 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %19, %15 ]
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %.lr.ph114, label %._crit_edge115

.lr.ph114:                                        ; preds = %._crit_edge
  %45 = zext i32 %43 to i64
  %.unpack.i = load ptr, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1), align 8
  %.unpack18.unpack.unpack.i = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7), align 16
  %.unpack18.unpack.unpack23.i = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7, i64 0, i64 2), align 16
  br label %46

46:                                               ; preds = %.lr.ph114, %._crit_edge111
  %indvars.iv122 = phi i64 [ 0, %.lr.ph114 ], [ %indvars.iv.next123, %._crit_edge111 ]
  %.neg112 = phi i32 [ 0, %.lr.ph114 ], [ %.neg, %._crit_edge111 ]
  %indvars125 = trunc i64 %indvars.iv122 to i32
  %.not = icmp eq i64 %indvars.iv122, 0
  br i1 %.not, label %_QMmod_binary_indexed_treePadd.exit40, label %.preheader.i

.preheader.i:                                     ; preds = %46
  %47 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not25.i = icmp slt i32 %47, 1
  br i1 %.not25.i, label %_QMmod_binary_indexed_treePadd.exit, label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.preheader.i, %.lr.ph.i
  %.026.i = phi i32 [ %56, %.lr.ph.i ], [ 1, %.preheader.i ]
  %48 = sext i32 %.026.i to i64
  %49 = sub i64 %48, %.unpack18.unpack.unpack.i
  %50 = mul i64 %49, %.unpack18.unpack.unpack23.i
  %51 = getelementptr i8, ptr %.unpack.i, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !3
  %53 = add i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !3
  %54 = sub i32 0, %.026.i
  %55 = and i32 %.026.i, %54
  %56 = add i32 %55, %.026.i
  %57 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i31 = icmp sgt i32 %56, %57
  br i1 %.not.i31, label %_QMmod_binary_indexed_treePadd.exit, label %.lr.ph.i

_QMmod_binary_indexed_treePadd.exit:              ; preds = %.lr.ph.i, %.preheader.i
  %58 = phi i32 [ %47, %.preheader.i ], [ %57, %.lr.ph.i ]
  %59 = add nsw i64 %indvars.iv122, -1
  %60 = getelementptr [2000 x i32], ptr @_QFEib, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !3
  %62 = icmp eq i32 %61, 0
  %.not25.i32 = icmp sgt i32 %61, %58
  %or.cond = select i1 %62, i1 true, i1 %.not25.i32
  br i1 %or.cond, label %_QMmod_binary_indexed_treePadd.exit40, label %.lr.ph.i37

.lr.ph.i37:                                       ; preds = %_QMmod_binary_indexed_treePadd.exit, %.lr.ph.i37
  %.026.i38 = phi i32 [ %71, %.lr.ph.i37 ], [ %61, %_QMmod_binary_indexed_treePadd.exit ]
  %63 = sext i32 %.026.i38 to i64
  %64 = sub i64 %63, %.unpack18.unpack.unpack.i
  %65 = mul i64 %64, %.unpack18.unpack.unpack23.i
  %66 = getelementptr i8, ptr %.unpack.i, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !3
  %68 = add i32 %67, -1
  store i32 %68, ptr %66, align 4, !tbaa !3
  %69 = sub i32 0, %.026.i38
  %70 = and i32 %.026.i38, %69
  %71 = add i32 %70, %.026.i38
  %72 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i39 = icmp sgt i32 %71, %72
  br i1 %.not.i39, label %_QMmod_binary_indexed_treePadd.exit40, label %.lr.ph.i37

_QMmod_binary_indexed_treePadd.exit40:            ; preds = %.lr.ph.i37, %_QMmod_binary_indexed_treePadd.exit, %46
  %73 = load i32, ptr %2, align 4, !tbaa !3
  %74 = icmp sgt i32 %73, -1
  br i1 %74, label %.lr.ph109, label %._crit_edge111

.lr.ph109:                                        ; preds = %_QMmod_binary_indexed_treePadd.exit40
  %75 = zext i32 %73 to i64
  %.unpack.i43 = load ptr, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1), align 8
  %.unpack18.unpack.unpack.i44 = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7), align 16
  %.unpack18.unpack.unpack23.i45 = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7, i64 0, i64 2), align 16
  %76 = add nsw i64 %indvars.iv122, -1
  %77 = getelementptr [2000 x i32], ptr @_QFEib, i64 0, i64 %76
  br label %78

78:                                               ; preds = %.lr.ph109, %144
  %indvars.iv = phi i64 [ 0, %.lr.ph109 ], [ %indvars.iv.next, %144 ]
  %.neg102108 = phi i32 [ 0, %.lr.ph109 ], [ %.neg102, %144 ]
  %indvars119 = trunc i64 %indvars.iv to i32
  %.not30 = icmp eq i64 %indvars.iv, 0
  br i1 %.not30, label %_QMmod_binary_indexed_treePadd.exit58, label %.preheader.i42

.preheader.i42:                                   ; preds = %78
  %79 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not25.i41 = icmp slt i32 %79, 1
  br i1 %.not25.i41, label %_QMmod_binary_indexed_treePadd.exit49, label %.lr.ph.i46

.lr.ph.i46:                                       ; preds = %.preheader.i42, %.lr.ph.i46
  %.026.i47 = phi i32 [ %88, %.lr.ph.i46 ], [ 1, %.preheader.i42 ]
  %80 = sext i32 %.026.i47 to i64
  %81 = sub i64 %80, %.unpack18.unpack.unpack.i44
  %82 = mul i64 %81, %.unpack18.unpack.unpack23.i45
  %83 = getelementptr i8, ptr %.unpack.i43, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !3
  %85 = add i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !3
  %86 = sub i32 0, %.026.i47
  %87 = and i32 %.026.i47, %86
  %88 = add i32 %87, %.026.i47
  %89 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i48 = icmp sgt i32 %88, %89
  br i1 %.not.i48, label %_QMmod_binary_indexed_treePadd.exit49, label %.lr.ph.i46

_QMmod_binary_indexed_treePadd.exit49:            ; preds = %.lr.ph.i46, %.preheader.i42
  %90 = phi i32 [ %79, %.preheader.i42 ], [ %89, %.lr.ph.i46 ]
  %91 = add nsw i64 %indvars.iv, -1
  %92 = getelementptr [2000 x i32], ptr @_QFEiw, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !3
  %94 = icmp eq i32 %93, 0
  %.not25.i50 = icmp sgt i32 %93, %90
  %or.cond100 = select i1 %94, i1 true, i1 %.not25.i50
  br i1 %or.cond100, label %_QMmod_binary_indexed_treePadd.exit58, label %.lr.ph.i55

.lr.ph.i55:                                       ; preds = %_QMmod_binary_indexed_treePadd.exit49, %.lr.ph.i55
  %.026.i56 = phi i32 [ %103, %.lr.ph.i55 ], [ %93, %_QMmod_binary_indexed_treePadd.exit49 ]
  %95 = sext i32 %.026.i56 to i64
  %96 = sub i64 %95, %.unpack18.unpack.unpack.i44
  %97 = mul i64 %96, %.unpack18.unpack.unpack23.i45
  %98 = getelementptr i8, ptr %.unpack.i43, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !3
  %100 = add i32 %99, -1
  store i32 %100, ptr %98, align 4, !tbaa !3
  %101 = sub i32 0, %.026.i56
  %102 = and i32 %.026.i56, %101
  %103 = add i32 %102, %.026.i56
  %104 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i57 = icmp sgt i32 %103, %104
  br i1 %.not.i57, label %_QMmod_binary_indexed_treePadd.exit58, label %.lr.ph.i55

_QMmod_binary_indexed_treePadd.exit58:            ; preds = %.lr.ph.i55, %_QMmod_binary_indexed_treePadd.exit49, %78
  br i1 %.not, label %123, label %105

105:                                              ; preds = %_QMmod_binary_indexed_treePadd.exit58
  %106 = getelementptr [2001 x [2001 x i32]], ptr @_QFEdp, i64 0, i64 %indvars.iv, i64 %indvars.iv122
  %107 = load i32, ptr %106, align 4, !tbaa !3
  %108 = getelementptr [2001 x [2001 x i32]], ptr @_QFEdp, i64 0, i64 %indvars.iv, i64 %76
  %109 = load i32, ptr %108, align 4, !tbaa !3
  %110 = load i32, ptr %77, align 4, !tbaa !3
  %111 = icmp sgt i32 %110, 0
  br i1 %111, label %.lr.ph.i60, label %_QMmod_binary_indexed_treePsummate.exit

.lr.ph.i60:                                       ; preds = %105, %.lr.ph.i60
  %.028.i = phi i32 [ %118, %.lr.ph.i60 ], [ %110, %105 ]
  %.0627.i = phi i32 [ %117, %.lr.ph.i60 ], [ 0, %105 ]
  %112 = zext i32 %.028.i to i64
  %113 = sub i64 %112, %.unpack18.unpack.unpack.i44
  %114 = mul i64 %113, %.unpack18.unpack.unpack23.i45
  %115 = getelementptr i8, ptr %.unpack.i43, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !3
  %117 = add i32 %116, %.0627.i
  %.not.i61 = add nsw i32 %.028.i, -1
  %118 = and i32 %.not.i61, %.028.i
  %.not29.i = icmp eq i32 %118, 0
  br i1 %.not29.i, label %_QMmod_binary_indexed_treePsummate.exit, label %.lr.ph.i60

_QMmod_binary_indexed_treePsummate.exit:          ; preds = %.lr.ph.i60, %105
  %.06.lcssa.i = phi i32 [ 0, %105 ], [ %117, %.lr.ph.i60 ]
  %119 = add i32 %.neg102108, %.neg112
  %.neg103 = add i32 %119, %109
  %120 = add i32 %.neg103, %110
  %121 = add i32 %120, %.06.lcssa.i
  %122 = call i32 @llvm.smin.i32(i32 %107, i32 %121)
  store i32 %122, ptr %106, align 4, !tbaa !3
  br label %123

123:                                              ; preds = %_QMmod_binary_indexed_treePsummate.exit, %_QMmod_binary_indexed_treePadd.exit58
  br i1 %.not30, label %144, label %124

124:                                              ; preds = %123
  %125 = getelementptr [2001 x [2001 x i32]], ptr @_QFEdp, i64 0, i64 %indvars.iv, i64 %indvars.iv122
  %126 = load i32, ptr %125, align 4, !tbaa !3
  %127 = add nsw i64 %indvars.iv, -1
  %128 = getelementptr [2001 x [2001 x i32]], ptr @_QFEdp, i64 0, i64 %127, i64 %indvars.iv122
  %129 = load i32, ptr %128, align 4, !tbaa !3
  %130 = getelementptr [2000 x i32], ptr @_QFEiw, i64 0, i64 %127
  %131 = load i32, ptr %130, align 4, !tbaa !3
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %.lr.ph.i65, label %_QMmod_binary_indexed_treePsummate.exit71

.lr.ph.i65:                                       ; preds = %124, %.lr.ph.i65
  %.028.i66 = phi i32 [ %139, %.lr.ph.i65 ], [ %131, %124 ]
  %.0627.i67 = phi i32 [ %138, %.lr.ph.i65 ], [ 0, %124 ]
  %133 = zext i32 %.028.i66 to i64
  %134 = sub i64 %133, %.unpack18.unpack.unpack.i44
  %135 = mul i64 %134, %.unpack18.unpack.unpack23.i45
  %136 = getelementptr i8, ptr %.unpack.i43, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !3
  %138 = add i32 %137, %.0627.i67
  %.not.i68 = add nsw i32 %.028.i66, -1
  %139 = and i32 %.not.i68, %.028.i66
  %.not29.i69 = icmp eq i32 %139, 0
  br i1 %.not29.i69, label %_QMmod_binary_indexed_treePsummate.exit71, label %.lr.ph.i65

_QMmod_binary_indexed_treePsummate.exit71:        ; preds = %.lr.ph.i65, %124
  %.06.lcssa.i70 = phi i32 [ 0, %124 ], [ %138, %.lr.ph.i65 ]
  %140 = add i32 %.neg102108, %.neg112
  %.neg104 = add i32 %140, %129
  %141 = add i32 %.neg104, %131
  %142 = add i32 %141, %.06.lcssa.i70
  %143 = call i32 @llvm.smin.i32(i32 %126, i32 %142)
  store i32 %143, ptr %125, align 4, !tbaa !3
  br label %144

144:                                              ; preds = %_QMmod_binary_indexed_treePsummate.exit71, %123
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.neg102 = xor i32 %indvars119, -1
  %exitcond120.not = icmp eq i64 %indvars.iv, %75
  br i1 %exitcond120.not, label %._crit_edge110, label %78

._crit_edge110:                                   ; preds = %144
  %.pre127 = load i32, ptr %2, align 4, !tbaa !3
  %145 = icmp sgt i32 %.pre127, 0
  br i1 %145, label %.preheader.i73.lr.ph, label %._crit_edge111

.preheader.i73.lr.ph:                             ; preds = %._crit_edge110
  %146 = zext i32 %.pre127 to i64
  %.unpack.i74 = load ptr, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1), align 8
  %.unpack18.unpack.unpack.i75 = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7), align 16
  %.unpack18.unpack.unpack23.i76 = load i64, ptr getelementptr inbounds (%_QMmod_binary_indexed_treeTfenwick_tree, ptr @_QFEbit, i64 0, i32 1, i32 7, i64 0, i64 2), align 16
  %.pre128 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  br label %.preheader.i73

.preheader.i73:                                   ; preds = %.preheader.i73.lr.ph, %_QMmod_binary_indexed_treePadd.exit89
  %147 = phi i32 [ %.pre128, %.preheader.i73.lr.ph ], [ %175, %_QMmod_binary_indexed_treePadd.exit89 ]
  %148 = phi i64 [ %146, %.preheader.i73.lr.ph ], [ %176, %_QMmod_binary_indexed_treePadd.exit89 ]
  %.not25.i72 = icmp slt i32 %147, 1
  br i1 %.not25.i72, label %_QMmod_binary_indexed_treePadd.exit80, label %.lr.ph.i77

.lr.ph.i77:                                       ; preds = %.preheader.i73, %.lr.ph.i77
  %.026.i78 = phi i32 [ %157, %.lr.ph.i77 ], [ 1, %.preheader.i73 ]
  %149 = sext i32 %.026.i78 to i64
  %150 = sub i64 %149, %.unpack18.unpack.unpack.i75
  %151 = mul i64 %150, %.unpack18.unpack.unpack23.i76
  %152 = getelementptr i8, ptr %.unpack.i74, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !3
  %154 = add i32 %153, -1
  store i32 %154, ptr %152, align 4, !tbaa !3
  %155 = sub i32 0, %.026.i78
  %156 = and i32 %.026.i78, %155
  %157 = add i32 %156, %.026.i78
  %158 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i79 = icmp sgt i32 %157, %158
  br i1 %.not.i79, label %_QMmod_binary_indexed_treePadd.exit80, label %.lr.ph.i77

_QMmod_binary_indexed_treePadd.exit80:            ; preds = %.lr.ph.i77, %.preheader.i73
  %159 = phi i32 [ %147, %.preheader.i73 ], [ %158, %.lr.ph.i77 ]
  %sext = shl i64 %148, 32
  %160 = ashr exact i64 %sext, 32
  %161 = add nsw i64 %160, -1
  %162 = getelementptr [2000 x i32], ptr @_QFEiw, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !3
  %164 = icmp eq i32 %163, 0
  %.not25.i81 = icmp sgt i32 %163, %159
  %or.cond101 = select i1 %164, i1 true, i1 %.not25.i81
  br i1 %or.cond101, label %_QMmod_binary_indexed_treePadd.exit89, label %.lr.ph.i86

.lr.ph.i86:                                       ; preds = %_QMmod_binary_indexed_treePadd.exit80, %.lr.ph.i86
  %.026.i87 = phi i32 [ %173, %.lr.ph.i86 ], [ %163, %_QMmod_binary_indexed_treePadd.exit80 ]
  %165 = sext i32 %.026.i87 to i64
  %166 = sub i64 %165, %.unpack18.unpack.unpack.i75
  %167 = mul i64 %166, %.unpack18.unpack.unpack23.i76
  %168 = getelementptr i8, ptr %.unpack.i74, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !3
  %170 = add i32 %169, 1
  store i32 %170, ptr %168, align 4, !tbaa !3
  %171 = sub i32 0, %.026.i87
  %172 = and i32 %.026.i87, %171
  %173 = add i32 %172, %.026.i87
  %174 = load i32, ptr @_QFEbit, align 16, !tbaa !3
  %.not.i88 = icmp sgt i32 %173, %174
  br i1 %.not.i88, label %_QMmod_binary_indexed_treePadd.exit89, label %.lr.ph.i86

_QMmod_binary_indexed_treePadd.exit89:            ; preds = %.lr.ph.i86, %_QMmod_binary_indexed_treePadd.exit80
  %175 = phi i32 [ %159, %_QMmod_binary_indexed_treePadd.exit80 ], [ %174, %.lr.ph.i86 ]
  %176 = add nsw i64 %148, -1
  %177 = icmp sgt i64 %148, 1
  br i1 %177, label %.preheader.i73, label %._crit_edge111

._crit_edge111:                                   ; preds = %_QMmod_binary_indexed_treePadd.exit89, %_QMmod_binary_indexed_treePadd.exit40, %._crit_edge110
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %.neg = xor i32 %indvars125, -1
  %exitcond126.not = icmp eq i64 %indvars.iv122, %45
  br i1 %exitcond126.not, label %._crit_edge115, label %46

._crit_edge115:                                   ; preds = %._crit_edge111, %._crit_edge
  %178 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d5de655624804eee6af32ac6fad82c66, i32 118)
  %179 = load i32, ptr %2, align 4, !tbaa !3
  %180 = sext i32 %179 to i64
  %181 = getelementptr [2001 x [2001 x i32]], ptr @_QFEdp, i64 0, i64 %180, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !3
  %183 = call i1 @_FortranAioOutputInteger32(ptr %178, i32 %182)
  %184 = call i32 @_FortranAioEndIoStatement(ptr %178)
  call void @_QMmod_binary_indexed_treePrelease_bit(ptr nonnull @_QFEbit)
  %185 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

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

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

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

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

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

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 nounwind memory(write, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #3 = { mustprogress nounwind willreturn }
attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) }
attributes #5 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) }
attributes #6 = { nofree nosync nounwind memory(read, inaccessiblemem: none) }
attributes #7 = { noreturn }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
