program main
Implicit None
	integer(8)::n,m,i,j,g,f,e
	integer(8),allocatable::k(:),s(:,:),p(:),gs(:)
	character(len = 60),allocatable::str(:)
	
	read*,n,m
	allocate(k(m),p(m),s(m,n),str(m),gs(n))
	s = 0
	
	do i = 1,m
		read"(a60)",str(i)
	enddo
	read*,p
	
	do i =1,m
		g = 0
		do j = 1,60
			if(str(i)(j:j) == " " .and. g == 0)then
				read(str(i)(1:j-1),*) k(i)
				f = j+1
				g = 1
				cycle
			endif
			if(str(i)(j:j) == " " .and. g /= 0)then
				read(str(i)(f:j-1),*) s(i,g)
				f = j+1
				g = g+1
				if(g > k(i)) exit
			endif
		enddo
	enddo
	
	g = 0
	do i = 0,2**(n)-1
		call nb(i,n,gs)
		do j = 1,m
			e = 0
			do f = 1,n
				if(s(j,f) == 0) exit
				if(gs(s(j,f)) == 1) e = e+1
			enddo
			if (mod(e,2) /= p(j)) exit
			if(j == m) g = g+1
		enddo
	enddo
	print"(i0)",g
end program main

subroutine nb(i1,n,gs)
Implicit None
	integer(8)::i1,i,n,k,p,j
	integer(8)::gs(n)
	
	i = i1
	gs = 0
	k = int(log(real(i))/log(real(2)))+1
	do j = 1,k
		p = mod(i,2)
		i = (i-p)/2
		gs(j) = p
	enddo
end subroutine nb

; 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"

@_QFEgs.0 = internal unnamed_addr global ptr null
@_QFEk.0 = internal unnamed_addr global ptr null
@_QFEp.0 = internal unnamed_addr global ptr null
@_QFEp.8 = internal unnamed_addr global i64 0
@_QFEs.0 = internal unnamed_addr global ptr null
@_QFEs.7 = internal unnamed_addr global i64 1
@_QFEs.8 = internal unnamed_addr global i64 0
@_QFEs.10 = internal unnamed_addr global i64 1
@_QFEstr.0 = internal unnamed_addr global ptr null
@_QQcl.3b52f096a2f35357ba70d693b91a42d3 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4187/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_QQcl.2861363029 = linkonce constant [5 x i8] c"(a60)"
@_QQcl.20 = linkonce constant [1 x i8] c" "
@_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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 7)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %8 = load i64, ptr %2, align 8, !tbaa !3
  %9 = call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = shl i64 %9, 3
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEk.0, align 8, !tbaa !7
  %12 = call ptr @malloc(i64 %10)
  store ptr %12, ptr @_QFEp.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEp.8, align 8, !tbaa !7
  %13 = load i64, ptr %3, align 8, !tbaa !3
  %14 = call i64 @llvm.smax.i64(i64 %13, i64 0)
  %15 = mul i64 %14, %10
  %16 = call ptr @malloc(i64 %15)
  store ptr %16, ptr @_QFEs.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEs.7, align 8, !tbaa !7
  store i64 %9, ptr @_QFEs.8, align 8, !tbaa !7
  store i64 1, ptr @_QFEs.10, align 8, !tbaa !7
  %17 = mul i64 %9, 60
  %18 = call ptr @malloc(i64 %17)
  store ptr %18, ptr @_QFEstr.0, align 8, !tbaa !7
  %19 = shl i64 %14, 3
  %20 = call ptr @malloc(i64 %19)
  store ptr %20, ptr @_QFEgs.0, align 8, !tbaa !7
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %23, label %.preheader1055

.preheader1055:                                   ; preds = %0
  %.not1087 = icmp slt i64 %13, 1
  br i1 %.not1087, label %._crit_edge1056, label %.preheader1054.lr.ph

.preheader1054.lr.ph:                             ; preds = %.preheader1055
  %.not1088 = icmp slt i64 %8, 1
  br i1 %.not1088, label %._crit_edge, label %._crit_edge1056.thread

._crit_edge1056.thread:                           ; preds = %.preheader1054.lr.ph
  %21 = mul i64 %9, %14
  %22 = shl i64 %21, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %16, i8 0, i64 %22, i1 false), !tbaa !3
  br label %.lr.ph.preheader

23:                                               ; preds = %0
  %24 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 9)
  %.pre.pre = load i64, ptr %2, align 8, !tbaa !3
  %.unpack1020.unpack1021.unpack.pre = load i64, ptr @_QFEs.10, align 8, !tbaa !7
  %.unpack1020.unpack.unpack.pre = load i64, ptr @_QFEs.7, align 8, !tbaa !7
  %25 = icmp slt i64 %8, 1
  %26 = select i1 %25, i64 1, i64 %.unpack1020.unpack.unpack.pre
  %27 = icmp slt i64 %13, 1
  %28 = select i1 %27, i64 1, i64 %.unpack1020.unpack1021.unpack.pre
  store ptr %16, ptr @_QFEs.0, align 8, !tbaa !7
  store i64 %26, ptr @_QFEs.7, align 8, !tbaa !7
  store i64 %9, ptr @_QFEs.8, align 8, !tbaa !7
  store i64 %28, ptr @_QFEs.10, align 8, !tbaa !7
  br label %._crit_edge1056

._crit_edge1056:                                  ; preds = %.preheader1055, %23
  %29 = phi i64 [ %.pre.pre, %23 ], [ %8, %.preheader1055 ]
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %._crit_edge1056.thread, %._crit_edge1056
  %31 = phi i64 [ %8, %._crit_edge1056.thread ], [ %29, %._crit_edge1056 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %32 = phi i64 [ %38, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %33 = call ptr @_FortranAioBeginExternalFormattedInput(ptr nonnull @_QQcl.2861363029, i64 5, ptr null, i32 -1, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 12)
  %.unpack1001 = load ptr, ptr @_QFEstr.0, align 8, !tbaa !7
  %34 = add i64 %32, -1
  %35 = getelementptr [60 x i8], ptr %.unpack1001, i64 %34
  %36 = call i1 @_FortranAioInputAscii(ptr %33, ptr %35, i64 60)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %33)
  %38 = add nuw i64 %32, 1
  %exitcond.not = icmp eq i64 %32, %31
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader1054.lr.ph, %._crit_edge1056
  %39 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 14)
  %.unpack847 = load ptr, ptr @_QFEp.0, align 8, !tbaa !7
  %.unpack854.unpack.unpack856 = load i64, ptr @_QFEp.8, align 8, !tbaa !7
  store ptr %.unpack847, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = 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.gep, align 8, !tbaa !7
  %.fca.3.gep = 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.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = 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.gep, align 2, !tbaa !7
  %.fca.6.gep = 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.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = 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 %.unpack854.unpack.unpack856, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = 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 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %40 = call i1 @_FortranAioInputDescriptor(ptr %39, ptr nonnull %1)
  %41 = call i32 @_FortranAioEndIoStatement(ptr %39)
  %42 = load i64, ptr %2, align 8, !tbaa !3
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.preheader, label %._crit_edge1064

.preheader:                                       ; preds = %._crit_edge, %90
  %.07681063 = phi i64 [ %.3771, %90 ], [ undef, %._crit_edge ]
  %storemerge1061 = phi i64 [ %91, %90 ], [ 1, %._crit_edge ]
  %44 = add i64 %storemerge1061, -1
  %45 = add i64 %storemerge1061, -1
  %46 = add i64 %storemerge1061, -1
  %47 = add i64 %storemerge1061, -1
  %48 = add i64 %storemerge1061, -1
  br label %49

49:                                               ; preds = %.preheader, %89
  %.01060 = phi i64 [ 1, %.preheader ], [ %.pre-phi, %89 ]
  %.07661059 = phi i64 [ 0, %.preheader ], [ %.1767, %89 ]
  %.17691058 = phi i64 [ %.07681063, %.preheader ], [ %.2770, %89 ]
  %.unpack913 = load ptr, ptr @_QFEstr.0, align 8, !tbaa !7
  %50 = getelementptr [60 x i8], ptr %.unpack913, i64 %44
  %51 = add nsw i64 %.01060, -1
  %52 = getelementptr [60 x [1 x i8]], ptr %50, i64 0, i64 %51
  %53 = call i32 @_FortranACharacterCompareScalar1(ptr %52, ptr nonnull @_QQcl.20, i64 1, i64 1)
  %54 = icmp eq i32 %53, 0
  %55 = icmp eq i64 %.07661059, 0
  %56 = and i1 %55, %54
  %.unpack977 = load ptr, ptr @_QFEstr.0, align 8, !tbaa !7
  %57 = getelementptr [60 x i8], ptr %.unpack977, i64 %45
  br i1 %56, label %58, label %64

58:                                               ; preds = %49
  %59 = call ptr @_FortranAioBeginInternalListInput(ptr %57, i64 %51, ptr null, i64 0, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 20)
  %.unpack989 = load ptr, ptr @_QFEk.0, align 8, !tbaa !7
  %60 = getelementptr i64, ptr %.unpack989, i64 %48
  %61 = call i1 @_FortranAioInputInteger(ptr %59, ptr %60, i32 8)
  %62 = call i32 @_FortranAioEndIoStatement(ptr %59)
  %63 = add nuw nsw i64 %.01060, 1
  br label %89

64:                                               ; preds = %49
  %65 = getelementptr [60 x [1 x i8]], ptr %57, i64 0, i64 %51
  %66 = call i32 @_FortranACharacterCompareScalar1(ptr %65, ptr nonnull @_QQcl.20, i64 1, i64 1)
  %67 = icmp eq i32 %66, 0
  %68 = icmp ne i64 %.07661059, 0
  %69 = and i1 %68, %67
  br i1 %69, label %70, label %._crit_edge1101

._crit_edge1101:                                  ; preds = %64
  %.pre1102 = add nuw nsw i64 %.01060, 1
  br label %89

70:                                               ; preds = %64
  %.unpack937 = load ptr, ptr @_QFEstr.0, align 8, !tbaa !7
  %71 = getelementptr [60 x i8], ptr %.unpack937, i64 %46
  %72 = add i64 %.17691058, -1
  %73 = getelementptr [60 x [1 x i8]], ptr %71, i64 0, i64 %72
  %74 = sub i64 %.01060, %.17691058
  %75 = call i64 @llvm.smax.i64(i64 %74, i64 0)
  %76 = call ptr @_FortranAioBeginInternalListInput(ptr %73, i64 %75, ptr null, i64 0, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 26)
  %.unpack949 = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  %.unpack956.unpack.unpack = load i64, ptr @_QFEs.7, align 8, !tbaa !7
  %.unpack956.unpack.unpack959 = load i64, ptr @_QFEs.8, align 8, !tbaa !7
  %.unpack956.unpack957.unpack = load i64, ptr @_QFEs.10, align 8, !tbaa !7
  %77 = sub i64 %storemerge1061, %.unpack956.unpack.unpack
  %78 = sub i64 %.07661059, %.unpack956.unpack957.unpack
  %79 = mul i64 %78, %.unpack956.unpack.unpack959
  %80 = add i64 %77, %79
  %81 = getelementptr i64, ptr %.unpack949, i64 %80
  %82 = call i1 @_FortranAioInputInteger(ptr %76, ptr %81, i32 8)
  %83 = call i32 @_FortranAioEndIoStatement(ptr %76)
  %84 = add nuw nsw i64 %.01060, 1
  %85 = add i64 %.07661059, 1
  %.unpack965 = load ptr, ptr @_QFEk.0, align 8, !tbaa !7
  %86 = getelementptr i64, ptr %.unpack965, i64 %47
  %87 = load i64, ptr %86, align 8, !tbaa !3
  %88 = icmp sgt i64 %85, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %._crit_edge1101, %58, %70
  %.pre-phi = phi i64 [ %.pre1102, %._crit_edge1101 ], [ %63, %58 ], [ %84, %70 ]
  %.2770 = phi i64 [ %.17691058, %._crit_edge1101 ], [ %63, %58 ], [ %84, %70 ]
  %.1767 = phi i64 [ %.07661059, %._crit_edge1101 ], [ 1, %58 ], [ %85, %70 ]
  %exitcond1092.not = icmp eq i64 %.pre-phi, 61
  br i1 %exitcond1092.not, label %90, label %49

90:                                               ; preds = %70, %89
  %.3771 = phi i64 [ %84, %70 ], [ %.2770, %89 ]
  %91 = add nuw i64 %storemerge1061, 1
  %exitcond1093.not = icmp eq i64 %storemerge1061, %42
  br i1 %exitcond1093.not, label %._crit_edge1064, label %.preheader

._crit_edge1064:                                  ; preds = %90, %._crit_edge
  %92 = load i64, ptr %3, align 8, !tbaa !3
  %93 = icmp eq i64 %92, 0
  br i1 %93, label %.lr.ph1085, label %94

94:                                               ; preds = %._crit_edge1064
  %95 = icmp slt i64 %92, 1
  br i1 %95, label %._crit_edge1086, label %.preheader.i

.preheader.i:                                     ; preds = %94
  %96 = and i64 %92, 1
  %.not3.i = icmp eq i64 %96, 0
  %97 = select i1 %.not3.i, i64 1, i64 2
  %98 = icmp eq i64 %92, 1
  br i1 %98, label %.lr.ph1085, label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.preheader.i, %.lr.ph.i
  %spec.select4.i = phi i64 [ %spec.select.i, %.lr.ph.i ], [ %97, %.preheader.i ]
  %99 = phi i64 [ %101, %.lr.ph.i ], [ %92, %.preheader.i ]
  %100 = phi i64 [ %102, %.lr.ph.i ], [ 2, %.preheader.i ]
  %101 = lshr i64 %99, 1
  %102 = mul i64 %100, %100
  %103 = and i64 %99, 2
  %.not.i = icmp eq i64 %103, 0
  %104 = select i1 %.not.i, i64 1, i64 %102
  %spec.select.i = mul i64 %104, %spec.select4.i
  %105 = icmp ult i64 %99, 4
  br i1 %105, label %__mlir_math_ipowi_i64.exit, label %.lr.ph.i

__mlir_math_ipowi_i64.exit:                       ; preds = %.lr.ph.i
  %106 = icmp sgt i64 %spec.select.i, 0
  br i1 %106, label %.lr.ph1085, label %._crit_edge1086

.lr.ph1085:                                       ; preds = %.preheader.i, %._crit_edge1064, %__mlir_math_ipowi_i64.exit
  %common.ret.op.i1105 = phi i64 [ %spec.select.i, %__mlir_math_ipowi_i64.exit ], [ %97, %.preheader.i ], [ 1, %._crit_edge1064 ]
  %.unpack860 = load ptr, ptr @_QFEgs.0, align 8, !tbaa !7
  %.unpack885 = load ptr, ptr @_QFEs.0, align 8
  %.unpack892.unpack.unpack = load i64, ptr @_QFEs.7, align 8
  %.unpack892.unpack.unpack895 = load i64, ptr @_QFEs.8, align 8
  %.unpack892.unpack893.unpack = load i64, ptr @_QFEs.10, align 8
  %.unpack872 = load ptr, ptr @_QFEp.0, align 8
  br label %107

107:                                              ; preds = %.lr.ph1085, %._crit_edge1077
  %.21084 = phi i64 [ 0, %.lr.ph1085 ], [ %.3.lcssa, %._crit_edge1077 ]
  %storemerge8591082 = phi i64 [ 0, %.lr.ph1085 ], [ %160, %._crit_edge1077 ]
  %108 = load i64, ptr %3, align 8, !tbaa !3
  %.not.i1042 = icmp slt i64 %108, 1
  br i1 %.not.i1042, label %._crit_edge.i, label %.lr.ph.preheader.i

.lr.ph.preheader.i:                               ; preds = %107
  %109 = shl nuw i64 %108, 3
  call void @llvm.memset.p0.i64(ptr align 8 %.unpack860, i8 0, i64 %109, i1 false), !tbaa !3
  br label %._crit_edge.i

._crit_edge.i:                                    ; preds = %.lr.ph.preheader.i, %107
  %110 = sitofp i64 %storemerge8591082 to float
  %111 = call contract float @llvm.log.f32(float %110)
  %112 = fdiv contract float %111, 0x3FE62E4300000000
  %113 = fptosi float %112 to i32
  %114 = icmp ult i32 %113, 2147483647
  br i1 %114, label %.lr.ph12.preheader.i, label %nb_.exit

.lr.ph12.preheader.i:                             ; preds = %._crit_edge.i
  %115 = add nuw nsw i32 %113, 1
  %116 = zext i32 %115 to i64
  br label %.lr.ph12.i

.lr.ph12.i:                                       ; preds = %.lr.ph12.i, %.lr.ph12.preheader.i
  %117 = phi i64 [ %124, %.lr.ph12.i ], [ %116, %.lr.ph12.preheader.i ]
  %118 = phi i64 [ %123, %.lr.ph12.i ], [ 1, %.lr.ph12.preheader.i ]
  %.010.i = phi i64 [ %120, %.lr.ph12.i ], [ %storemerge8591082, %.lr.ph12.preheader.i ]
  %119 = srem i64 %.010.i, 2
  %120 = sdiv i64 %.010.i, 2
  %121 = add nsw i64 %118, -1
  %122 = getelementptr i64, ptr %.unpack860, i64 %121
  store i64 %119, ptr %122, align 8, !tbaa !3
  %123 = add nuw nsw i64 %118, 1
  %124 = add nsw i64 %117, -1
  %125 = icmp ugt i64 %117, 1
  br i1 %125, label %.lr.ph12.i, label %nb_.exit

nb_.exit:                                         ; preds = %.lr.ph12.i, %._crit_edge.i
  %126 = load i64, ptr %2, align 8, !tbaa !3
  %127 = icmp sgt i64 %126, 0
  br i1 %127, label %.lr.ph1076, label %._crit_edge1077

.lr.ph1076:                                       ; preds = %nb_.exit
  %128 = load i64, ptr %3, align 8, !tbaa !3
  %129 = icmp sgt i64 %128, 0
  br i1 %129, label %.lr.ph1069.us, label %.lr.ph1076.split

.lr.ph1069.us:                                    ; preds = %.lr.ph1076, %149
  %.11075.us = phi i64 [ %152, %149 ], [ 1, %.lr.ph1076 ]
  %.31074.us = phi i64 [ %spec.select1041.us, %149 ], [ %.21084, %.lr.ph1076 ]
  %130 = sub i64 %.11075.us, %.unpack892.unpack.unpack
  br label %131

131:                                              ; preds = %.lr.ph1069.us, %138
  %.47721067.us = phi i64 [ 1, %.lr.ph1069.us ], [ %144, %138 ]
  %.07731066.us = phi i64 [ 0, %.lr.ph1069.us ], [ %spec.select.us, %138 ]
  %132 = sub i64 %.47721067.us, %.unpack892.unpack893.unpack
  %133 = mul i64 %132, %.unpack892.unpack.unpack895
  %134 = add i64 %130, %133
  %135 = getelementptr i64, ptr %.unpack885, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !3
  %137 = icmp eq i64 %136, 0
  br i1 %137, label %._crit_edge1070.us, label %138

138:                                              ; preds = %131
  %139 = add i64 %136, -1
  %140 = getelementptr i64, ptr %.unpack860, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !3
  %142 = icmp eq i64 %141, 1
  %143 = zext i1 %142 to i64
  %spec.select.us = add i64 %.07731066.us, %143
  %144 = add nuw i64 %.47721067.us, 1
  %exitcond1095.not = icmp eq i64 %.47721067.us, %128
  br i1 %exitcond1095.not, label %._crit_edge1070.us, label %131

._crit_edge1070.us:                               ; preds = %138, %131
  %.0773.lcssa.us = phi i64 [ %.07731066.us, %131 ], [ %spec.select.us, %138 ]
  %145 = srem i64 %.0773.lcssa.us, 2
  %146 = add i64 %.11075.us, -1
  %147 = getelementptr i64, ptr %.unpack872, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !3
  %.not884.us = icmp eq i64 %145, %148
  br i1 %.not884.us, label %149, label %._crit_edge1077

149:                                              ; preds = %._crit_edge1070.us
  %150 = icmp eq i64 %.11075.us, %126
  %151 = zext i1 %150 to i64
  %spec.select1041.us = add i64 %.31074.us, %151
  %152 = add nuw i64 %.11075.us, 1
  %exitcond1096.not = icmp eq i64 %.11075.us, %126
  br i1 %exitcond1096.not, label %._crit_edge1077, label %.lr.ph1069.us

.lr.ph1076.split:                                 ; preds = %.lr.ph1076, %156
  %.11075 = phi i64 [ %159, %156 ], [ 1, %.lr.ph1076 ]
  %.31074 = phi i64 [ %spec.select1041, %156 ], [ %.21084, %.lr.ph1076 ]
  %153 = add i64 %.11075, -1
  %154 = getelementptr i64, ptr %.unpack872, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !3
  %.not884 = icmp eq i64 %155, 0
  br i1 %.not884, label %156, label %._crit_edge1077

156:                                              ; preds = %.lr.ph1076.split
  %157 = icmp eq i64 %.11075, %126
  %158 = zext i1 %157 to i64
  %spec.select1041 = add i64 %.31074, %158
  %159 = add nuw i64 %.11075, 1
  %exitcond1094.not = icmp eq i64 %.11075, %126
  br i1 %exitcond1094.not, label %._crit_edge1077, label %.lr.ph1076.split

._crit_edge1077:                                  ; preds = %156, %.lr.ph1076.split, %149, %._crit_edge1070.us, %nb_.exit
  %.3.lcssa = phi i64 [ %.21084, %nb_.exit ], [ %.31074.us, %._crit_edge1070.us ], [ %spec.select1041.us, %149 ], [ %.31074, %.lr.ph1076.split ], [ %spec.select1041, %156 ]
  %160 = add nuw i64 %storemerge8591082, 1
  %exitcond1097.not = icmp eq i64 %160, %common.ret.op.i1105
  br i1 %exitcond1097.not, label %._crit_edge1086, label %107

._crit_edge1086:                                  ; preds = %._crit_edge1077, %94, %__mlir_math_ipowi_i64.exit
  %.2.lcssa = phi i64 [ 0, %__mlir_math_ipowi_i64.exit ], [ 0, %94 ], [ %.3.lcssa, %._crit_edge1077 ]
  %161 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.3b52f096a2f35357ba70d693b91a42d3, i32 47)
  %162 = call i1 @_FortranAioOutputInteger64(ptr %161, i64 %.2.lcssa)
  %163 = call i32 @_FortranAioEndIoStatement(ptr %161)
  ret void
}

; Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
define void @nb_(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture writeonly %2) local_unnamed_addr #1 {
  %4 = load i64, ptr %1, align 8, !tbaa !3
  %5 = load i64, ptr %0, align 8, !tbaa !3
  %.not = icmp slt i64 %4, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

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

._crit_edge:                                      ; preds = %.lr.ph.preheader, %3
  %7 = sitofp i64 %5 to float
  %8 = tail call contract float @llvm.log.f32(float %7)
  %9 = fdiv contract float %8, 0x3FE62E4300000000
  %10 = fptosi float %9 to i32
  %11 = icmp ult i32 %10, 2147483647
  br i1 %11, label %.lr.ph12.preheader, label %._crit_edge13

.lr.ph12.preheader:                               ; preds = %._crit_edge
  %12 = add nuw nsw i32 %10, 1
  %13 = zext i32 %12 to i64
  br label %.lr.ph12

.lr.ph12:                                         ; preds = %.lr.ph12.preheader, %.lr.ph12
  %14 = phi i64 [ %21, %.lr.ph12 ], [ %13, %.lr.ph12.preheader ]
  %15 = phi i64 [ %20, %.lr.ph12 ], [ 1, %.lr.ph12.preheader ]
  %.010 = phi i64 [ %17, %.lr.ph12 ], [ %5, %.lr.ph12.preheader ]
  %16 = srem i64 %.010, 2
  %17 = sdiv i64 %.010, 2
  %18 = add nsw i64 %15, -1
  %19 = getelementptr i64, ptr %2, i64 %18
  store i64 %16, ptr %19, align 8, !tbaa !3
  %20 = add nuw nsw i64 %15, 1
  %21 = add nsw i64 %14, -1
  %22 = icmp ugt i64 %14, 1
  br i1 %22, label %.lr.ph12, label %._crit_edge13

._crit_edge13:                                    ; preds = %.lr.ph12, %._crit_edge
  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 {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

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

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

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nofree nosync nounwind memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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}
