program main
	implicit none
	integer N, M, i, j
	integer, allocatable :: a(:), b(:), c(:)
	read(*, *) N, M
	allocate(a(1: M))
	allocate(b(1: M))
	allocate(c(1: N))
	do i = 1, M
		read(*, *) a(i), b(i)
	end do
	c(1: N) = 0
	do i = 1, N
		do j = 1, M
			if(a(j) == i) then
				c(i) = c(i) + 1
			end if
			if(b(j) == i) then
				c(i) = c(i) + 1
			end if
		end do
	end do
	do i = 1, N
		write(*, *) c(i)
	end do
end program main
; 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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEc.0 = internal unnamed_addr global ptr null
@_QQcl.02342e2eef77c5254e1c8d302e914f47 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7296/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.02342e2eef77c5254e1c8d302e914f47, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %1, align 4, !tbaa !3
  %8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %9 = zext i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEa.0, align 8, !tbaa !7
  %12 = call ptr @malloc(i64 %10)
  store ptr %12, ptr @_QFEb.0, align 8, !tbaa !7
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = call i32 @llvm.smax.i32(i32 %13, i32 0)
  %15 = zext i32 %14 to i64
  %16 = shl nuw nsw i64 %15, 2
  %17 = call ptr @malloc(i64 %16)
  store ptr %17, ptr @_QFEc.0, align 8, !tbaa !7
  %18 = icmp sgt i32 %7, 0
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %20 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.02342e2eef77c5254e1c8d302e914f47, i32 10)
  %.unpack363 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %21 = add nsw i64 %indvars.iv, -1
  %22 = getelementptr i32, ptr %.unpack363, i64 %21
  %23 = call i1 @_FortranAioInputInteger(ptr %20, ptr %22, i32 4)
  %.unpack375 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr i32, ptr %.unpack375, i64 %24
  %26 = call i1 @_FortranAioInputInteger(ptr %20, ptr %25, i32 4)
  %27 = call i32 @_FortranAioEndIoStatement(ptr %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %19
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.unpack.pre = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %28 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %13, %0 ]
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.loopexit ], [ %17, %0 ]
  %.not = icmp slt i32 %28, 1
  br i1 %.not, label %._crit_edge398, label %._crit_edge389

._crit_edge389:                                   ; preds = %._crit_edge
  %29 = zext i32 %28 to i64
  %30 = shl nuw nsw i64 %29, 2
  call void @llvm.memset.p0.i64(ptr align 4 %.unpack, i8 0, i64 %30, i1 false), !tbaa !3
  %.pre414 = load i32, ptr %2, align 4, !tbaa !3
  %31 = icmp sgt i32 %.pre414, 0
  br i1 %31, label %.lr.ph394, label %._crit_edge398

.lr.ph394:                                        ; preds = %._crit_edge389
  %32 = zext i32 %.pre414 to i64
  %.unpack315 = load ptr, ptr @_QFEa.0, align 8
  %.unpack327 = load ptr, ptr @_QFEb.0, align 8
  br label %33

33:                                               ; preds = %.lr.ph394, %._crit_edge392
  %indvars.iv404 = phi i64 [ 1, %.lr.ph394 ], [ %indvars.iv.next405, %._crit_edge392 ]
  %34 = load i32, ptr %1, align 4, !tbaa !3
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph391, label %._crit_edge392

.lr.ph391:                                        ; preds = %33
  %36 = zext i32 %34 to i64
  %37 = add nsw i64 %indvars.iv404, -1
  %38 = getelementptr i32, ptr %.unpack, i64 %37
  br label %39

39:                                               ; preds = %.lr.ph391, %57
  %indvars.iv400 = phi i64 [ 1, %.lr.ph391 ], [ %indvars.iv.next401, %57 ]
  %40 = add nsw i64 %indvars.iv400, -1
  %41 = getelementptr i32, ptr %.unpack315, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !3
  %43 = zext i32 %42 to i64
  %44 = icmp eq i64 %indvars.iv404, %43
  br i1 %44, label %45, label %48

45:                                               ; preds = %39
  %46 = load i32, ptr %38, align 4, !tbaa !3
  %47 = add i32 %46, 1
  store i32 %47, ptr %38, align 4, !tbaa !3
  br label %48

48:                                               ; preds = %45, %39
  %49 = add nsw i64 %indvars.iv400, -1
  %50 = getelementptr i32, ptr %.unpack327, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !3
  %52 = zext i32 %51 to i64
  %53 = icmp eq i64 %indvars.iv404, %52
  br i1 %53, label %54, label %57

54:                                               ; preds = %48
  %55 = load i32, ptr %38, align 4, !tbaa !3
  %56 = add i32 %55, 1
  store i32 %56, ptr %38, align 4, !tbaa !3
  br label %57

57:                                               ; preds = %54, %48
  %indvars.iv.next401 = add nuw nsw i64 %indvars.iv400, 1
  %exitcond403.not = icmp eq i64 %indvars.iv400, %36
  br i1 %exitcond403.not, label %._crit_edge392, label %39

._crit_edge392:                                   ; preds = %57, %33
  %indvars.iv.next405 = add nuw nsw i64 %indvars.iv404, 1
  %exitcond407.not = icmp eq i64 %indvars.iv404, %32
  br i1 %exitcond407.not, label %._crit_edge395, label %33

._crit_edge395:                                   ; preds = %._crit_edge392
  %.pre415 = load i32, ptr %2, align 4, !tbaa !3
  %58 = icmp sgt i32 %.pre415, 0
  br i1 %58, label %.lr.ph397.preheader, label %._crit_edge398

.lr.ph397.preheader:                              ; preds = %._crit_edge395
  %59 = zext i32 %.pre415 to i64
  br label %.lr.ph397

.lr.ph397:                                        ; preds = %.lr.ph397.preheader, %.lr.ph397
  %indvars.iv408 = phi i64 [ 1, %.lr.ph397.preheader ], [ %indvars.iv.next409, %.lr.ph397 ]
  %60 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.02342e2eef77c5254e1c8d302e914f47, i32 24)
  %.unpack303 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %61 = add nsw i64 %indvars.iv408, -1
  %62 = getelementptr i32, ptr %.unpack303, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !3
  %64 = call i1 @_FortranAioOutputInteger32(ptr %60, i32 %63)
  %65 = call i32 @_FortranAioEndIoStatement(ptr %60)
  %indvars.iv.next409 = add nuw nsw i64 %indvars.iv408, 1
  %exitcond411.not = icmp eq i64 %indvars.iv408, %59
  br i1 %exitcond411.not, label %._crit_edge398, label %.lr.ph397

._crit_edge398:                                   ; preds = %.lr.ph397, %._crit_edge, %._crit_edge389, %._crit_edge395
  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 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 i32 @llvm.smax.i32(i32, i32) #1

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

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