program main
	implicit none
	integer n
	integer ::i,nin=0,bnin
	integer,allocatable,dimension(:)::a,b
	read(*,*)n
	allocate(a(n))
	allocate(b(n))	
	do i=1,n
		read(*,*)a(i),b(i)
	enddo
	do i=1,n
		if(nin<a(i))then
			nin=a(i)
			bnin=b(i)
		endif
	enddo
	nin=nin+bnin
	write(*,*)nin
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
@_QFEnin = internal unnamed_addr global i32 0
@_QQcl.ce8bfa73507a7a072a037dbdc70cb98b = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6862/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 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ce8bfa73507a7a072a037dbdc70cb98b, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = shl nuw nsw i64 %7, 2
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEa.0, align 8, !tbaa !7
  %10 = call ptr @malloc(i64 %8)
  store ptr %10, ptr @_QFEb.0, align 8, !tbaa !7
  %11 = icmp sgt i32 %5, 0
  br i1 %11, label %.lr.ph.preheader, label %._crit_edge.._crit_edge226_crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %12 = zext i32 %5 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 ]
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ce8bfa73507a7a072a037dbdc70cb98b, i32 10)
  %.unpack199 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %14 = add nsw i64 %indvars.iv, -1
  %15 = getelementptr i32, ptr %.unpack199, i64 %14
  %16 = call i1 @_FortranAioInputInteger(ptr %13, ptr %15, i32 4)
  %.unpack211 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %17 = add nsw i64 %indvars.iv, -1
  %18 = getelementptr i32, ptr %.unpack211, i64 %17
  %19 = call i1 @_FortranAioInputInteger(ptr %13, ptr %18, i32 4)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %12
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !3
  %21 = icmp sgt i32 %.pre, 0
  br i1 %21, label %.lr.ph225, label %._crit_edge.._crit_edge226_crit_edge

._crit_edge.._crit_edge226_crit_edge:             ; preds = %0, %._crit_edge
  %.pre232 = load i32, ptr @_QFEnin, align 4, !tbaa !3
  br label %._crit_edge226

.lr.ph225:                                        ; preds = %._crit_edge
  %22 = zext i32 %.pre to i64
  %_QFEnin.promoted = load i32, ptr @_QFEnin, align 4, !tbaa !3
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack187 = load ptr, ptr @_QFEb.0, align 8
  %xtraiter = and i64 %22, 1
  %23 = icmp eq i32 %.pre, 1
  br i1 %23, label %._crit_edge226.loopexit.unr-lcssa, label %.lr.ph225.new

.lr.ph225.new:                                    ; preds = %.lr.ph225
  %unroll_iter = and i64 %22, 4294967294
  br label %24

24:                                               ; preds = %42, %.lr.ph225.new
  %indvars.iv228 = phi i64 [ 1, %.lr.ph225.new ], [ %indvars.iv.next229.1, %42 ]
  %.0223 = phi i32 [ undef, %.lr.ph225.new ], [ %.1.1, %42 ]
  %25 = phi i32 [ %_QFEnin.promoted, %.lr.ph225.new ], [ %43, %42 ]
  %niter = phi i64 [ 0, %.lr.ph225.new ], [ %niter.next.1, %42 ]
  %26 = add nsw i64 %indvars.iv228, -1
  %27 = getelementptr i32, ptr %.unpack, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !3
  %29 = icmp slt i32 %25, %28
  br i1 %29, label %30, label %34

30:                                               ; preds = %24
  %31 = add nsw i64 %indvars.iv228, -1
  %32 = getelementptr i32, ptr %.unpack187, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !3
  br label %34

34:                                               ; preds = %30, %24
  %35 = phi i32 [ %28, %30 ], [ %25, %24 ]
  %.1 = phi i32 [ %33, %30 ], [ %.0223, %24 ]
  %36 = getelementptr i32, ptr %.unpack, i64 %indvars.iv228
  %37 = load i32, ptr %36, align 4, !tbaa !3
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %39, label %42

39:                                               ; preds = %34
  %40 = getelementptr i32, ptr %.unpack187, i64 %indvars.iv228
  %41 = load i32, ptr %40, align 4, !tbaa !3
  br label %42

42:                                               ; preds = %39, %34
  %43 = phi i32 [ %37, %39 ], [ %35, %34 ]
  %.1.1 = phi i32 [ %41, %39 ], [ %.1, %34 ]
  %indvars.iv.next229.1 = add nuw nsw i64 %indvars.iv228, 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_edge226.loopexit.unr-lcssa.loopexit, label %24

._crit_edge226.loopexit.unr-lcssa.loopexit:       ; preds = %42
  %44 = add nuw nsw i64 %indvars.iv228, 1
  br label %._crit_edge226.loopexit.unr-lcssa

._crit_edge226.loopexit.unr-lcssa:                ; preds = %._crit_edge226.loopexit.unr-lcssa.loopexit, %.lr.ph225
  %.lcssa.ph = phi i32 [ undef, %.lr.ph225 ], [ %43, %._crit_edge226.loopexit.unr-lcssa.loopexit ]
  %indvars.iv228.unr = phi i64 [ 0, %.lr.ph225 ], [ %44, %._crit_edge226.loopexit.unr-lcssa.loopexit ]
  %.0223.unr = phi i32 [ undef, %.lr.ph225 ], [ %.1.1, %._crit_edge226.loopexit.unr-lcssa.loopexit ]
  %.unr = phi i32 [ %_QFEnin.promoted, %.lr.ph225 ], [ %43, %._crit_edge226.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge226, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge226.loopexit.unr-lcssa
  %45 = getelementptr i32, ptr %.unpack, i64 %indvars.iv228.unr
  %46 = load i32, ptr %45, align 4, !tbaa !3
  %47 = icmp slt i32 %.unr, %46
  br i1 %47, label %48, label %._crit_edge226

48:                                               ; preds = %.epil.preheader
  %49 = getelementptr i32, ptr %.unpack187, i64 %indvars.iv228.unr
  %50 = load i32, ptr %49, align 4, !tbaa !3
  br label %._crit_edge226

._crit_edge226:                                   ; preds = %._crit_edge226.loopexit.unr-lcssa, %48, %.epil.preheader, %._crit_edge.._crit_edge226_crit_edge
  %51 = phi i32 [ %.pre232, %._crit_edge.._crit_edge226_crit_edge ], [ %.lcssa.ph, %._crit_edge226.loopexit.unr-lcssa ], [ %46, %48 ], [ %.unr, %.epil.preheader ]
  %.0.lcssa = phi i32 [ undef, %._crit_edge.._crit_edge226_crit_edge ], [ %.0223.unr, %._crit_edge226.loopexit.unr-lcssa ], [ %50, %48 ], [ %.0223.unr, %.epil.preheader ]
  %52 = add i32 %51, %.0.lcssa
  store i32 %52, ptr @_QFEnin, align 4, !tbaa !3
  %53 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ce8bfa73507a7a072a037dbdc70cb98b, i32 19)
  %54 = load i32, ptr @_QFEnin, align 4, !tbaa !3
  %55 = call i1 @_FortranAioOutputInteger32(ptr %53, i32 %54)
  %56 = call i32 @_FortranAioEndIoStatement(ptr %53)
  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

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}
