PROGRAM ATCODER

implicit none
integer :: n,i,ans=0
integer,allocatable :: v(:), c(:)

read*, n
allocate(v(n),c(n))
read*, v(1:n), c(1:n)

do i = 1, n, 1
  if ( v(i)-c(i) > 0 ) then
    ans = ans + v(i) - c(i)
  end if
end do

print'(i0)', ans 

END PROGRAM ATCODER
; 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"

@_QFEans = internal unnamed_addr global i32 0
@_QFEc.0 = internal unnamed_addr global ptr null
@_QFEv.0 = internal unnamed_addr global ptr null
@_QQcl.5c2213bbaa724b2a30888bca9dec6470 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4373/source.f\00"
@_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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5c2213bbaa724b2a30888bca9dec6470, i32 7)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = load i32, ptr %3, 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 @_QFEv.0, align 8, !tbaa !7
  %12 = call ptr @malloc(i64 %10)
  store ptr %12, ptr @_QFEc.0, align 8, !tbaa !7
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5c2213bbaa724b2a30888bca9dec6470, i32 9)
  %.unpack = load ptr, ptr @_QFEv.0, align 8, !tbaa !7
  %14 = load i32, ptr %3, align 4, !tbaa !3
  %15 = call i32 @llvm.smax.i32(i32 %14, i32 0)
  %16 = zext i32 %15 to i64
  store ptr %.unpack, ptr %2, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, 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 %2, 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 %2, 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 %2, i64 0, i32 4
  store i8 9, 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 %2, 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 %2, 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 %2, 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 %2, i64 0, i32 7, i64 0, i64 1
  store i64 %16, 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 %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %17 = call i1 @_FortranAioInputDescriptor(ptr %13, ptr nonnull %2)
  %.unpack279 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %18 = load i32, ptr %3, align 4, !tbaa !3
  %19 = call i32 @llvm.smax.i32(i32 %18, i32 0)
  %20 = zext i32 %19 to i64
  store ptr %.unpack279, ptr %1, align 8, !tbaa !7
  %.fca.1.gep113 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep113, align 8, !tbaa !7
  %.fca.2.gep115 = 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.gep115, align 8, !tbaa !7
  %.fca.3.gep117 = 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.gep117, align 4, !tbaa !7
  %.fca.4.gep119 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep119, align 1, !tbaa !7
  %.fca.5.gep121 = 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.gep121, align 2, !tbaa !7
  %.fca.6.gep123 = 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.gep123, align 1, !tbaa !7
  %.fca.7.0.0.gep125 = 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.gep125, align 8, !tbaa !7
  %.fca.7.0.1.gep127 = 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 %20, ptr %.fca.7.0.1.gep127, align 8, !tbaa !7
  %.fca.7.0.2.gep129 = 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 4, ptr %.fca.7.0.2.gep129, align 8, !tbaa !7
  %21 = call i1 @_FortranAioInputDescriptor(ptr %13, ptr nonnull %1)
  %22 = call i32 @_FortranAioEndIoStatement(ptr %13)
  %23 = load i32, ptr %3, align 4, !tbaa !3
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %25 = zext i32 %23 to i64
  %_QFEans.promoted = load i32, ptr @_QFEans, align 4, !tbaa !3
  %.unpack291 = load ptr, ptr @_QFEv.0, align 8, !tbaa !7
  %.unpack303 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %xtraiter = and i64 %25, 1
  %26 = icmp eq i32 %23, 1
  br i1 %26, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %25, 4294967294
  br label %27

27:                                               ; preds = %49, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %49 ]
  %28 = phi i32 [ %_QFEans.promoted, %.lr.ph.new ], [ %50, %49 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %49 ]
  %29 = add nsw i64 %indvars.iv, -1
  %30 = getelementptr i32, ptr %.unpack291, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !3
  %32 = add nsw i64 %indvars.iv, -1
  %33 = getelementptr i32, ptr %.unpack303, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !3
  %35 = sub i32 %31, %34
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %27
  %38 = add i32 %35, %28
  store i32 %38, ptr @_QFEans, align 4, !tbaa !3
  br label %39

39:                                               ; preds = %37, %27
  %40 = phi i32 [ %38, %37 ], [ %28, %27 ]
  %41 = getelementptr i32, ptr %.unpack291, i64 %indvars.iv
  %42 = load i32, ptr %41, align 4, !tbaa !3
  %43 = getelementptr i32, ptr %.unpack303, i64 %indvars.iv
  %44 = load i32, ptr %43, align 4, !tbaa !3
  %45 = sub i32 %42, %44
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %39
  %48 = add i32 %45, %40
  store i32 %48, ptr @_QFEans, align 4, !tbaa !3
  br label %49

49:                                               ; preds = %47, %39
  %50 = phi i32 [ %48, %47 ], [ %40, %39 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa.loopexit, label %27

._crit_edge.loopexit.unr-lcssa.loopexit:          ; preds = %49
  %51 = add nuw nsw i64 %indvars.iv, 1
  br label %._crit_edge.loopexit.unr-lcssa

._crit_edge.loopexit.unr-lcssa:                   ; preds = %._crit_edge.loopexit.unr-lcssa.loopexit, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %51, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %.unr = phi i32 [ %_QFEans.promoted, %.lr.ph ], [ %50, %._crit_edge.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa
  %52 = getelementptr i32, ptr %.unpack291, i64 %indvars.iv.unr
  %53 = load i32, ptr %52, align 4, !tbaa !3
  %54 = getelementptr i32, ptr %.unpack303, i64 %indvars.iv.unr
  %55 = load i32, ptr %54, align 4, !tbaa !3
  %56 = sub i32 %53, %55
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %._crit_edge

58:                                               ; preds = %.epil.preheader
  %59 = add i32 %56, %.unr
  store i32 %59, ptr @_QFEans, align 4, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %58, %.epil.preheader, %0
  %60 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.5c2213bbaa724b2a30888bca9dec6470, i32 17)
  %61 = load i32, ptr @_QFEans, align 4, !tbaa !3
  %62 = call i1 @_FortranAioOutputInteger32(ptr %60, i32 %61)
  %63 = call i32 @_FortranAioEndIoStatement(ptr %60)
  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 i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, 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

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) }

!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}
