module deque_mod
    implicit none
    type deque
        integer(4),pointer:: v(:)
        integer(4):: l,r
        integer(4):: lmax, rmax
    end type
    private
    public:: deque
    public:: init_deque
    public:: append, appendleft
    public:: pop, popleft
    public:: right, left
    public:: remaining_elements
    public:: remain

contains
    subroutine init_deque(dq)
        ! 初期化
        type(deque):: dq
        dq%r=0; dq%rmax=1
        dq%l=1; dq%lmax=-1
        allocate(dq%v(dq%lmax:dq%rmax))
    end subroutine


    subroutine append(dq,num)
        ! 右端に挿入
        type(deque):: dq
        integer(4):: num
        if (dq%r+1 > dq%rmax) call add_(dq)
        dq%r=dq%r+1
        dq%v(dq%r) = num
    end subroutine

    subroutine appendleft(dq,num)
        ! 左端に挿入
        type(deque):: dq
        integer(4):: num
        if (dq%l-1 < dq%lmax) call add_(dq)
        dq%l=dq%l-1
        dq%v(dq%l) = num
    end subroutine

    subroutine add_(dq)
        ! arrayの延長
        type(deque):: dq
        integer(4):: l
        integer(4),pointer:: tmp(:)
        l = size(dq%v)
        allocate(tmp(l))
        tmp(:) = dq%v(:)
        deallocate(dq%v)
        allocate(dq%v(2*dq%lmax:2*dq%rmax))
        dq%v(dq%lmax:dq%rmax) = tmp(:)
        dq%lmax = 2*dq%lmax
        dq%rmax = 2*dq%rmax
    end subroutine


    function pop(dq) result(ret)
        ! 右端から取り出し
        type(deque):: dq
        integer(4):: ret
        ret = dq%v(dq%r)
        dq%r=dq%r-1
    end function

    function popleft(dq) result(ret)
        ! 左端から取り出し
        type(deque):: dq
        integer(4):: ret
        ret = dq%v(dq%l)
        dq%l=dq%l+1
    end function


    function right(dq) result(ret)
        ! 右端を確認
        type(deque):: dq
        integer(4):: ret
        ret = dq%v(dq%r)
    end function

    function left(dq) result(ret)
        ! 左端を確認
        type(deque):: dq
        integer(4):: ret
        ret = dq%v(dq%l)
    end function

    function remaining_elements(dq) result(ret)
        ! 残りの要素数
        type(deque):: dq
        integer(4):: ret 
        ret = dq%r - dq%l + 1
    end function

    function remain(dq) result(ret)
        ! 要素が残っているかどうか
        type(deque):: dq
        logical:: ret
        ret = remaining_elements(dq) > 0
    end function
end module


program name
    use deque_mod
    implicit none
    integer(4):: n,i,cnt,nmax
    type(deque) d

    call init_deque(d)

    read*, n

    call append(d,3)
    call append(d,5)
    call append(d,7)

    nmax = popleft(d)
    cnt=0
    do while(nmax <= n)
        if (shitigosan(nmax))cnt=cnt+1
        call append(d,10*nmax+3)
        call append(d,10*nmax+5)
        call append(d,10*nmax+7)
        nmax = popleft(d)
    end do

    print*, cnt


contains
function shitigosan(num) result(ret)
    logical:: ret, ok3, ok5, ok7
    integer(4):: num,inum,i

    inum = num
    ok3=.false.
    ok5=.false.
    ok7=.false.
    do while(inum>0)
        i = mod(inum,10)
        if (i==3) ok3=.true.
        if (i==5) ok5=.true.
        if (i==7) ok7=.true.
        inum=inum/10
    end do
    ret = ok3 .and. ok5 .and. ok7

end function



end program name
; 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"

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

@_QQcl.fe514c2b4d58c647cf683bb531ef402a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5340/source.f\00"
@_QFEd = internal global %_QMdeque_modTdeque undef
@_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: mustprogress nofree nounwind willreturn memory(argmem: write, inaccessiblemem: readwrite)
define void @_QMdeque_modPinit_deque(ptr nocapture writeonly %0) local_unnamed_addr #2 {
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  store i32 0, ptr %2, align 4, !tbaa !3
  %3 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 4
  store i32 1, ptr %3, align 4, !tbaa !3
  %4 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  store i32 1, ptr %4, align 4, !tbaa !3
  %5 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 3
  store i32 -1, ptr %5, align 4, !tbaa !3
  %6 = tail call dereferenceable_or_null(12) ptr @malloc(i64 12)
  store ptr %6, ptr %0, align 8, !tbaa !7
  %.repack11 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  store i64 4, ptr %.repack11, align 8, !tbaa !7
  %.repack13 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 2
  store i32 20180515, ptr %.repack13, align 8, !tbaa !7
  %.repack15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 3
  store i8 1, ptr %.repack15, align 4, !tbaa !7
  %.repack17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 4
  store i8 9, ptr %.repack17, align 1, !tbaa !7
  %.repack19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 5
  store i8 1, ptr %.repack19, align 2, !tbaa !7
  %.repack21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 6
  store i8 0, ptr %.repack21, align 1, !tbaa !7
  %.repack23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  store i64 -1, ptr %.repack23, align 8, !tbaa !7
  %.repack23.repack25 = 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 3, ptr %.repack23.repack25, align 8, !tbaa !7
  %.repack23.repack26 = 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 4, ptr %.repack23.repack26, align 8, !tbaa !7
  ret void
}

; Function Attrs: nounwind
define void @_QMdeque_modPappend(ptr nocapture %0, ptr nocapture readonly %1) local_unnamed_addr #3 {
  %3 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  %4 = load i32, ptr %3, align 4, !tbaa !3
  %5 = add i32 %4, 1
  %6 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 4
  %7 = load i32, ptr %6, align 4, !tbaa !3
  %8 = icmp sgt i32 %5, %7
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @_QMdeque_modPadd_(ptr nonnull %0)
  %.pre = load i32, ptr %3, align 4, !tbaa !3
  %.pre22 = add i32 %.pre, 1
  br label %10

10:                                               ; preds = %9, %2
  %.pre-phi = phi i32 [ %.pre22, %9 ], [ %5, %2 ]
  store i32 %.pre-phi, ptr %3, align 4, !tbaa !3
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %12 = sext i32 %.pre-phi to i64
  %13 = sub i64 %12, %.unpack15.unpack.unpack
  %14 = mul i64 %13, %.unpack15.unpack.unpack20
  %15 = getelementptr i8, ptr %.unpack, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !3
  ret void
}

; Function Attrs: nounwind
define void @_QMdeque_modPappendleft(ptr nocapture %0, ptr nocapture readonly %1) local_unnamed_addr #3 {
  %3 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  %4 = load i32, ptr %3, align 4, !tbaa !3
  %5 = add i32 %4, -1
  %6 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 3
  %7 = load i32, ptr %6, align 4, !tbaa !3
  %8 = icmp slt i32 %5, %7
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @_QMdeque_modPadd_(ptr nonnull %0)
  %.pre = load i32, ptr %3, align 4, !tbaa !3
  %.pre22 = add i32 %.pre, -1
  br label %10

10:                                               ; preds = %9, %2
  %.pre-phi = phi i32 [ %.pre22, %9 ], [ %5, %2 ]
  store i32 %.pre-phi, ptr %3, align 4, !tbaa !3
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %12 = sext i32 %.pre-phi to i64
  %13 = sub i64 %12, %.unpack15.unpack.unpack
  %14 = mul i64 %13, %.unpack15.unpack.unpack20
  %15 = getelementptr i8, ptr %.unpack, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !3
  ret void
}

; Function Attrs: nounwind
define void @_QMdeque_modPadd_(ptr nocapture %0) local_unnamed_addr #3 {
  %.unpack330.unpack.elt332 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  %.unpack330.unpack.unpack333 = load i64, ptr %.unpack330.unpack.elt332, align 8, !tbaa !7
  %sext = shl i64 %.unpack330.unpack.unpack333, 32
  %2 = ashr exact i64 %sext, 32
  %3 = tail call i64 @llvm.smax.i64(i64 %2, i64 0)
  %4 = shl nuw nsw i64 %3, 2
  %5 = tail call ptr @malloc(i64 %4)
  %6 = tail call ptr @malloc(i64 %4)
  %.not = icmp slt i64 %sext, 4294967296
  br i1 %.not, label %.preheader406.thread, label %.lr.ph408.preheader

.preheader406.thread:                             ; preds = %1
  %.unpack422 = load ptr, ptr %0, align 8, !tbaa !7
  %.unpack350.unpack.elt354423 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  br label %._crit_edge410

.lr.ph408.preheader:                              ; preds = %1
  %7 = tail call i64 @llvm.smax.i64(i64 %2, i64 1)
  %8 = shl nuw nsw i64 %7, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %5, i64 %8, i1 false), !tbaa !3
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.unpack350.unpack.elt354 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack350.unpack.unpack355 = load i64, ptr %.unpack350.unpack.elt354, align 8, !tbaa !7
  br label %.lr.ph408

.preheader406:                                    ; preds = %.lr.ph408
  br i1 %.not, label %._crit_edge410, label %.lr.ph409.preheader

.lr.ph409.preheader:                              ; preds = %.preheader406
  %9 = tail call i64 @llvm.smax.i64(i64 %2, i64 1)
  %10 = shl nuw nsw i64 %9, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr nonnull align 4 %6, i64 %10, i1 false), !tbaa !3
  br label %._crit_edge410

.lr.ph408:                                        ; preds = %.lr.ph408.preheader, %.lr.ph408
  %11 = phi i64 [ %18, %.lr.ph408 ], [ %3, %.lr.ph408.preheader ]
  %12 = phi i64 [ %17, %.lr.ph408 ], [ 0, %.lr.ph408.preheader ]
  %13 = mul i64 %12, %.unpack350.unpack.unpack355
  %14 = getelementptr i8, ptr %.unpack, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !3
  %16 = getelementptr i32, ptr %6, i64 %12
  store i32 %15, ptr %16, align 4, !tbaa !3
  %17 = add nuw nsw i64 %12, 1
  %18 = add nsw i64 %11, -1
  %19 = icmp ugt i64 %11, 1
  br i1 %19, label %.lr.ph408, label %.preheader406

._crit_edge410:                                   ; preds = %.preheader406.thread, %.lr.ph409.preheader, %.preheader406
  %.unpack425430 = phi ptr [ %.unpack422, %.preheader406.thread ], [ %.unpack, %.lr.ph409.preheader ], [ %.unpack, %.preheader406 ]
  %.unpack350.unpack.elt354426429 = phi ptr [ %.unpack350.unpack.elt354423, %.preheader406.thread ], [ %.unpack350.unpack.elt354, %.lr.ph409.preheader ], [ %.unpack350.unpack.elt354, %.preheader406 ]
  tail call void @free(ptr %6)
  tail call void @free(ptr %.unpack425430)
  %.repack378 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  %.repack379 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 2
  %.repack380 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 3
  %.repack381 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 4
  %.repack382 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 5
  %.repack383 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 6
  %.repack384 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %20 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 3
  %21 = load i32, ptr %20, align 4, !tbaa !3
  %22 = shl i32 %21, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 4
  %25 = load i32, ptr %24, align 4, !tbaa !3
  %26 = shl i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = sub nsw i64 %27, %23
  %29 = or i64 %28, 1
  %30 = tail call i64 @llvm.smax.i64(i64 %29, i64 0)
  %31 = shl i64 %30, 2
  %32 = tail call ptr @malloc(i64 %31)
  %33 = icmp slt i64 %29, 1
  %34 = select i1 %33, i64 1, i64 %23
  store ptr %32, ptr %0, align 8, !tbaa !7
  store i64 4, ptr %.repack378, align 8, !tbaa !7
  store i32 20180515, ptr %.repack379, align 8, !tbaa !7
  store i8 1, ptr %.repack380, align 4, !tbaa !7
  store i8 9, ptr %.repack381, align 1, !tbaa !7
  store i8 1, ptr %.repack382, align 2, !tbaa !7
  store i8 0, ptr %.repack383, align 1, !tbaa !7
  store i64 %34, ptr %.repack384, align 8, !tbaa !7
  store i64 %30, ptr %.unpack330.unpack.elt332, align 8, !tbaa !7
  store i64 4, ptr %.unpack350.unpack.elt354426429, align 8, !tbaa !7
  %35 = sext i32 %21 to i64
  %36 = sext i32 %25 to i64
  %37 = sub nsw i64 %36, %35
  %38 = tail call i64 @llvm.smax.i64(i64 %37, i64 -1)
  %39 = tail call ptr @malloc(i64 %31)
  br i1 %33, label %.preheader405, label %.lr.ph412.preheader

.lr.ph412.preheader:                              ; preds = %._crit_edge410
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %32, i64 %31, i1 false), !tbaa !3
  br label %.preheader405

.preheader405:                                    ; preds = %.lr.ph412.preheader, %._crit_edge410
  %40 = icmp sgt i64 %37, -1
  br i1 %40, label %.lr.ph413, label %.preheader

.lr.ph413:                                        ; preds = %.preheader405
  %41 = sub nsw i64 %35, %34
  %42 = shl nsw i64 %41, 2
  %uglygep = getelementptr i8, ptr %39, i64 %42
  %43 = add nsw i64 %38, 2
  %44 = tail call i64 @llvm.smin.i64(i64 %38, i64 0)
  %smin421.neg = xor i64 %44, -1
  %45 = add i64 %43, %smin421.neg
  %46 = shl nuw nsw i64 %45, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %uglygep, ptr align 4 %5, i64 %46, i1 false), !tbaa !3
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph413, %.preheader405
  br i1 %33, label %._crit_edge415, label %.lr.ph414.preheader

.lr.ph414.preheader:                              ; preds = %.preheader
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %39, i64 %31, i1 false), !tbaa !3
  br label %._crit_edge415

._crit_edge415:                                   ; preds = %.lr.ph414.preheader, %.preheader
  tail call void @free(ptr %39)
  store i32 %22, ptr %20, align 4, !tbaa !3
  store i32 %26, ptr %24, align 4, !tbaa !3
  ret void
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none)
define i32 @_QMdeque_modPpop(ptr nocapture %0) local_unnamed_addr #4 {
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = sext i32 %3 to i64
  %5 = sub i64 %4, %.unpack15.unpack.unpack
  %6 = mul i64 %5, %.unpack15.unpack.unpack20
  %7 = getelementptr i8, ptr %.unpack, i64 %6
  %8 = load i32, ptr %7, align 4, !tbaa !3
  %9 = add i32 %3, -1
  store i32 %9, ptr %2, align 4, !tbaa !3
  ret i32 %8
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none)
define i32 @_QMdeque_modPpopleft(ptr nocapture %0) local_unnamed_addr #4 {
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = sext i32 %3 to i64
  %5 = sub i64 %4, %.unpack15.unpack.unpack
  %6 = mul i64 %5, %.unpack15.unpack.unpack20
  %7 = getelementptr i8, ptr %.unpack, i64 %6
  %8 = load i32, ptr %7, align 4, !tbaa !3
  %9 = add i32 %3, 1
  store i32 %9, ptr %2, align 4, !tbaa !3
  ret i32 %8
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
define i32 @_QMdeque_modPright(ptr nocapture readonly %0) local_unnamed_addr #5 {
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = sext i32 %3 to i64
  %5 = sub i64 %4, %.unpack15.unpack.unpack
  %6 = mul i64 %5, %.unpack15.unpack.unpack20
  %7 = getelementptr i8, ptr %.unpack, i64 %6
  %8 = load i32, ptr %7, align 4, !tbaa !3
  ret i32 %8
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
define i32 @_QMdeque_modPleft(ptr nocapture readonly %0) local_unnamed_addr #5 {
  %.unpack = load ptr, ptr %0, align 8, !tbaa !7
  %.elt14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7
  %.unpack15.unpack.unpack = load i64, ptr %.elt14, align 8, !tbaa !7
  %.unpack15.unpack.elt19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %.unpack15.unpack.unpack20 = load i64, ptr %.unpack15.unpack.elt19, align 8, !tbaa !7
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = sext i32 %3 to i64
  %5 = sub i64 %4, %.unpack15.unpack.unpack
  %6 = mul i64 %5, %.unpack15.unpack.unpack20
  %7 = getelementptr i8, ptr %.unpack, i64 %6
  %8 = load i32, ptr %7, align 4, !tbaa !3
  ret i32 %8
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)
define i32 @_QMdeque_modPremaining_elements(ptr nocapture readonly %0) local_unnamed_addr #6 {
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  %5 = load i32, ptr %4, align 4, !tbaa !3
  %6 = add i32 %3, 1
  %7 = sub i32 %6, %5
  ret i32 %7
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read)
define i32 @_QMdeque_modPremain(ptr nocapture readonly %0) local_unnamed_addr #6 {
  %2 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 2
  %3 = load i32, ptr %2, align 4, !tbaa !3
  %4 = getelementptr %_QMdeque_modTdeque, ptr %0, i64 0, i32 1
  %5 = load i32, ptr %4, align 4, !tbaa !3
  %6 = add i32 %3, 1
  %7 = sub i32 %6, %5
  %8 = icmp sgt i32 %7, 0
  %9 = zext i1 %8 to i32
  ret i32 %9
}

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  store i32 0, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  store i32 1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  store i32 1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 1), align 16, !tbaa !3
  store i32 -1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 3), align 8, !tbaa !3
  %2 = tail call dereferenceable_or_null(12) ptr @malloc(i64 12)
  store ptr %2, ptr @_QFEd, align 16, !tbaa !7
  store i64 4, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 3), align 4, !tbaa !7
  store i8 9, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 4), align 1, !tbaa !7
  store i8 1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 6), align 1, !tbaa !7
  store i64 -1, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  store i64 3, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 4, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.fe514c2b4d58c647cf683bb531ef402a, i32 116)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %7 = add i32 %6, 1
  %8 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %9 = icmp sgt i32 %7, %8
  br i1 %9, label %10, label %_QMdeque_modPappend.exit

10:                                               ; preds = %0
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i = add i32 %.pre.i, 1
  br label %_QMdeque_modPappend.exit

_QMdeque_modPappend.exit:                         ; preds = %0, %10
  %.pre-phi.i = phi i32 [ %.pre22.i, %10 ], [ %7, %0 ]
  store i32 %.pre-phi.i, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.unpack.i = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %11 = sext i32 %.pre-phi.i to i64
  %12 = sub i64 %11, %.unpack15.unpack.unpack.i
  %13 = mul i64 %12, %.unpack15.unpack.unpack20.i
  %14 = getelementptr i8, ptr %.unpack.i, i64 %13
  store i32 3, ptr %14, align 4, !tbaa !3
  %15 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %16 = add i32 %15, 1
  %17 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %18 = icmp sgt i32 %16, %17
  br i1 %18, label %19, label %_QMdeque_modPappend.exit9

19:                                               ; preds = %_QMdeque_modPappend.exit
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i3 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i4 = add i32 %.pre.i3, 1
  %.unpack.i6.pre = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i7.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i8.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  br label %_QMdeque_modPappend.exit9

_QMdeque_modPappend.exit9:                        ; preds = %_QMdeque_modPappend.exit, %19
  %.unpack15.unpack.unpack20.i8 = phi i64 [ %.unpack15.unpack.unpack20.i8.pre, %19 ], [ %.unpack15.unpack.unpack20.i, %_QMdeque_modPappend.exit ]
  %.unpack15.unpack.unpack.i7 = phi i64 [ %.unpack15.unpack.unpack.i7.pre, %19 ], [ %.unpack15.unpack.unpack.i, %_QMdeque_modPappend.exit ]
  %.unpack.i6 = phi ptr [ %.unpack.i6.pre, %19 ], [ %.unpack.i, %_QMdeque_modPappend.exit ]
  %.pre-phi.i5 = phi i32 [ %.pre22.i4, %19 ], [ %16, %_QMdeque_modPappend.exit ]
  store i32 %.pre-phi.i5, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %20 = sext i32 %.pre-phi.i5 to i64
  %21 = sub i64 %20, %.unpack15.unpack.unpack.i7
  %22 = mul i64 %21, %.unpack15.unpack.unpack20.i8
  %23 = getelementptr i8, ptr %.unpack.i6, i64 %22
  store i32 5, ptr %23, align 4, !tbaa !3
  %24 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %25 = add i32 %24, 1
  %26 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %27 = icmp sgt i32 %25, %26
  br i1 %27, label %28, label %_QMdeque_modPappend.exit16

28:                                               ; preds = %_QMdeque_modPappend.exit9
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i10 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i11 = add i32 %.pre.i10, 1
  %.unpack.i13.pre = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i14.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i15.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  br label %_QMdeque_modPappend.exit16

_QMdeque_modPappend.exit16:                       ; preds = %_QMdeque_modPappend.exit9, %28
  %.unpack15.unpack.unpack20.i15 = phi i64 [ %.unpack15.unpack.unpack20.i15.pre, %28 ], [ %.unpack15.unpack.unpack20.i8, %_QMdeque_modPappend.exit9 ]
  %.unpack15.unpack.unpack.i14 = phi i64 [ %.unpack15.unpack.unpack.i14.pre, %28 ], [ %.unpack15.unpack.unpack.i7, %_QMdeque_modPappend.exit9 ]
  %.unpack.i13 = phi ptr [ %.unpack.i13.pre, %28 ], [ %.unpack.i6, %_QMdeque_modPappend.exit9 ]
  %.pre-phi.i12 = phi i32 [ %.pre22.i11, %28 ], [ %25, %_QMdeque_modPappend.exit9 ]
  store i32 %.pre-phi.i12, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %29 = sext i32 %.pre-phi.i12 to i64
  %30 = sub i64 %29, %.unpack15.unpack.unpack.i14
  %31 = mul i64 %30, %.unpack15.unpack.unpack20.i15
  %32 = getelementptr i8, ptr %.unpack.i13, i64 %31
  store i32 7, ptr %32, align 4, !tbaa !3
  %33 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 1), align 16, !tbaa !3
  %34 = sext i32 %33 to i64
  %35 = sub i64 %34, %.unpack15.unpack.unpack.i14
  %36 = mul i64 %35, %.unpack15.unpack.unpack20.i15
  %37 = getelementptr i8, ptr %.unpack.i13, i64 %36
  %storemerge56 = load i32, ptr %37, align 4, !tbaa !3
  %storemerge5557 = add i32 %33, 1
  store i32 %storemerge5557, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 1), align 16, !tbaa !3
  %38 = load i32, ptr %1, align 4, !tbaa !3
  %.not58 = icmp sgt i32 %storemerge56, %38
  br i1 %.not58, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %_QMdeque_modPappend.exit16, %_QMdeque_modPappend.exit40
  %.unpack15.unpack.unpack20.i3986 = phi i64 [ %.unpack15.unpack.unpack20.i39, %_QMdeque_modPappend.exit40 ], [ %.unpack15.unpack.unpack20.i15, %_QMdeque_modPappend.exit16 ]
  %.unpack15.unpack.unpack.i3882 = phi i64 [ %.unpack15.unpack.unpack.i38, %_QMdeque_modPappend.exit40 ], [ %.unpack15.unpack.unpack.i14, %_QMdeque_modPappend.exit16 ]
  %.unpack.i3778 = phi ptr [ %.unpack.i37, %_QMdeque_modPappend.exit40 ], [ %.unpack.i13, %_QMdeque_modPappend.exit16 ]
  %storemerge60 = phi i32 [ %storemerge, %_QMdeque_modPappend.exit40 ], [ %storemerge56, %_QMdeque_modPappend.exit16 ]
  %.059 = phi i32 [ %52, %_QMdeque_modPappend.exit40 ], [ 0, %_QMdeque_modPappend.exit16 ]
  %39 = icmp sgt i32 %storemerge60, 0
  br i1 %39, label %.lr.ph.i, label %_QFPshitigosan.exit.thread

.lr.ph.i:                                         ; preds = %.lr.ph, %.lr.ph.i
  %.018.i = phi i32 [ %44, %.lr.ph.i ], [ %storemerge60, %.lr.ph ]
  %.01017.i = phi i32 [ %.1.i, %.lr.ph.i ], [ 0, %.lr.ph ]
  %.01116.i = phi i32 [ %.112.i, %.lr.ph.i ], [ 0, %.lr.ph ]
  %.01315.i = phi i32 [ %spec.select.i, %.lr.ph.i ], [ 0, %.lr.ph ]
  %40 = urem i32 %.018.i, 10
  %41 = icmp eq i32 %40, 3
  %spec.select.i = select i1 %41, i32 1, i32 %.01315.i
  %42 = icmp eq i32 %40, 5
  %.112.i = select i1 %42, i32 1, i32 %.01116.i
  %43 = icmp eq i32 %40, 7
  %.1.i = select i1 %43, i32 1, i32 %.01017.i
  %44 = udiv i32 %.018.i, 10
  %.not.i = icmp ult i32 %.018.i, 10
  br i1 %.not.i, label %_QFPshitigosan.exit, label %.lr.ph.i

_QFPshitigosan.exit:                              ; preds = %.lr.ph.i
  %45 = icmp ne i32 %spec.select.i, 0
  %46 = icmp ne i32 %.112.i, 0
  %47 = and i1 %46, %45
  %48 = icmp ne i32 %.1.i, 0
  %49 = and i1 %48, %47
  %.fr = freeze i1 %49
  %50 = add i32 %.059, 1
  br i1 %.fr, label %51, label %_QFPshitigosan.exit.thread

_QFPshitigosan.exit.thread:                       ; preds = %.lr.ph, %_QFPshitigosan.exit
  br label %51

51:                                               ; preds = %_QFPshitigosan.exit, %_QFPshitigosan.exit.thread
  %52 = phi i32 [ %.059, %_QFPshitigosan.exit.thread ], [ %50, %_QFPshitigosan.exit ]
  %53 = mul i32 %storemerge60, 10
  %54 = add i32 %53, 3
  %55 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %56 = add i32 %55, 1
  %57 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %58 = icmp sgt i32 %56, %57
  br i1 %58, label %59, label %_QMdeque_modPappend.exit26

59:                                               ; preds = %51
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i20 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i21 = add i32 %.pre.i20, 1
  %.unpack.i23.pre = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i24.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i25.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  br label %_QMdeque_modPappend.exit26

_QMdeque_modPappend.exit26:                       ; preds = %51, %59
  %.unpack15.unpack.unpack20.i3985 = phi i64 [ %.unpack15.unpack.unpack20.i25.pre, %59 ], [ %.unpack15.unpack.unpack20.i3986, %51 ]
  %.unpack15.unpack.unpack.i3881 = phi i64 [ %.unpack15.unpack.unpack.i24.pre, %59 ], [ %.unpack15.unpack.unpack.i3882, %51 ]
  %.unpack.i3777 = phi ptr [ %.unpack.i23.pre, %59 ], [ %.unpack.i3778, %51 ]
  %.pre-phi.i22 = phi i32 [ %.pre22.i21, %59 ], [ %56, %51 ]
  store i32 %.pre-phi.i22, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %60 = sext i32 %.pre-phi.i22 to i64
  %61 = sub i64 %60, %.unpack15.unpack.unpack.i3881
  %62 = mul i64 %61, %.unpack15.unpack.unpack20.i3985
  %63 = getelementptr i8, ptr %.unpack.i3777, i64 %62
  store i32 %54, ptr %63, align 4, !tbaa !3
  %64 = add i32 %53, 5
  %65 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %66 = add i32 %65, 1
  %67 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %68 = icmp sgt i32 %66, %67
  br i1 %68, label %69, label %_QMdeque_modPappend.exit33

69:                                               ; preds = %_QMdeque_modPappend.exit26
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i27 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i28 = add i32 %.pre.i27, 1
  %.unpack.i30.pre = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i31.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i32.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  br label %_QMdeque_modPappend.exit33

_QMdeque_modPappend.exit33:                       ; preds = %_QMdeque_modPappend.exit26, %69
  %.unpack15.unpack.unpack20.i3984 = phi i64 [ %.unpack15.unpack.unpack20.i32.pre, %69 ], [ %.unpack15.unpack.unpack20.i3985, %_QMdeque_modPappend.exit26 ]
  %.unpack15.unpack.unpack.i3880 = phi i64 [ %.unpack15.unpack.unpack.i31.pre, %69 ], [ %.unpack15.unpack.unpack.i3881, %_QMdeque_modPappend.exit26 ]
  %.unpack.i3776 = phi ptr [ %.unpack.i30.pre, %69 ], [ %.unpack.i3777, %_QMdeque_modPappend.exit26 ]
  %.pre-phi.i29 = phi i32 [ %.pre22.i28, %69 ], [ %66, %_QMdeque_modPappend.exit26 ]
  store i32 %.pre-phi.i29, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %70 = sext i32 %.pre-phi.i29 to i64
  %71 = sub i64 %70, %.unpack15.unpack.unpack.i3880
  %72 = mul i64 %71, %.unpack15.unpack.unpack20.i3984
  %73 = getelementptr i8, ptr %.unpack.i3776, i64 %72
  store i32 %64, ptr %73, align 4, !tbaa !3
  %74 = add i32 %53, 7
  %75 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %76 = add i32 %75, 1
  %77 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 4), align 4, !tbaa !3
  %78 = icmp sgt i32 %76, %77
  br i1 %78, label %79, label %_QMdeque_modPappend.exit40

79:                                               ; preds = %_QMdeque_modPappend.exit33
  call void @_QMdeque_modPadd_(ptr nonnull @_QFEd)
  %.pre.i34 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %.pre22.i35 = add i32 %.pre.i34, 1
  %.unpack.i37.pre = load ptr, ptr @_QFEd, align 16, !tbaa !7
  %.unpack15.unpack.unpack.i38.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7), align 8, !tbaa !7
  %.unpack15.unpack.unpack20.i39.pre = load i64, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  br label %_QMdeque_modPappend.exit40

_QMdeque_modPappend.exit40:                       ; preds = %_QMdeque_modPappend.exit33, %79
  %.unpack15.unpack.unpack20.i39 = phi i64 [ %.unpack15.unpack.unpack20.i39.pre, %79 ], [ %.unpack15.unpack.unpack20.i3984, %_QMdeque_modPappend.exit33 ]
  %.unpack15.unpack.unpack.i38 = phi i64 [ %.unpack15.unpack.unpack.i38.pre, %79 ], [ %.unpack15.unpack.unpack.i3880, %_QMdeque_modPappend.exit33 ]
  %.unpack.i37 = phi ptr [ %.unpack.i37.pre, %79 ], [ %.unpack.i3776, %_QMdeque_modPappend.exit33 ]
  %.pre-phi.i36 = phi i32 [ %.pre22.i35, %79 ], [ %76, %_QMdeque_modPappend.exit33 ]
  store i32 %.pre-phi.i36, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 2), align 4, !tbaa !3
  %80 = sext i32 %.pre-phi.i36 to i64
  %81 = sub i64 %80, %.unpack15.unpack.unpack.i38
  %82 = mul i64 %81, %.unpack15.unpack.unpack20.i39
  %83 = getelementptr i8, ptr %.unpack.i37, i64 %82
  store i32 %74, ptr %83, align 4, !tbaa !3
  %84 = load i32, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 1), align 16, !tbaa !3
  %85 = sext i32 %84 to i64
  %86 = sub i64 %85, %.unpack15.unpack.unpack.i38
  %87 = mul i64 %86, %.unpack15.unpack.unpack20.i39
  %88 = getelementptr i8, ptr %.unpack.i37, i64 %87
  %storemerge = load i32, ptr %88, align 4, !tbaa !3
  %storemerge55 = add i32 %84, 1
  store i32 %storemerge55, ptr getelementptr inbounds (%_QMdeque_modTdeque, ptr @_QFEd, i64 0, i32 1), align 16, !tbaa !3
  %89 = load i32, ptr %1, align 4, !tbaa !3
  %.not = icmp sgt i32 %storemerge, %89
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %_QMdeque_modPappend.exit40, %_QMdeque_modPappend.exit16
  %.0.lcssa = phi i32 [ 0, %_QMdeque_modPappend.exit16 ], [ %52, %_QMdeque_modPappend.exit40 ]
  %90 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.fe514c2b4d58c647cf683bb531ef402a, i32 132)
  %91 = call i1 @_FortranAioOutputInteger32(ptr %90, i32 %.0.lcssa)
  %92 = call i32 @_FortranAioEndIoStatement(ptr %90)
  ret void
}

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

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.018 = phi i32 [ %8, %.lr.ph ], [ %2, %1 ]
  %.01017 = phi i32 [ %.1, %.lr.ph ], [ 0, %1 ]
  %.01116 = phi i32 [ %.112, %.lr.ph ], [ 0, %1 ]
  %.01315 = phi i32 [ %spec.select, %.lr.ph ], [ 0, %1 ]
  %4 = urem i32 %.018, 10
  %5 = icmp eq i32 %4, 3
  %spec.select = select i1 %5, i32 1, i32 %.01315
  %6 = icmp eq i32 %4, 5
  %.112 = select i1 %6, i32 1, i32 %.01116
  %7 = icmp eq i32 %4, 7
  %.1 = select i1 %7, i32 1, i32 %.01017
  %8 = udiv i32 %.018, 10
  %.not = icmp ult i32 %.018, 10
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %9 = icmp ne i32 %spec.select, 0
  %10 = icmp ne i32 %.112, 0
  %11 = and i1 %9, %10
  %12 = icmp ne i32 %.1, 0
  %13 = and i1 %11, %12
  %14 = zext i1 %13 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %1
  %15 = phi i32 [ %14, %._crit_edge.loopexit ], [ 0, %1 ]
  ret i32 %15
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_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) #8

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

; 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) #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 = { mustprogress nofree nounwind willreturn memory(argmem: write, inaccessiblemem: readwrite) }
attributes #3 = { nounwind }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
attributes #7 = { nofree norecurse nosync nounwind memory(argmem: read) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"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}
