program main
integer ::a,b,c,d,e1=1,e2=1,i,j
integer,allocatable :: x(:),y(:)

read(*,*)a,b,c,d
allocate(x(a),y(b))
read(*,*)x(1:a)
read(*,*)y(1:b)
do i=c+1,d-1
	e1 = 1
    e2 = 1
	do j =1,a
    	if (x(j)>=i) then
        	e1=0
            exit
        end if
    end do
    do j =1,b
    	if (y(j)<i) then
        	e2=0
            exit
        end if
    end do
    if (e1==1 .and. e2==1) exit
end do
if(e1==1 .and. e2==1) then
	write(*,*)"No War"
else 
	write(*,*)"War"
end if
end program

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

@_QFEe1 = internal unnamed_addr global i1 false
@_QFEe2 = internal unnamed_addr global i1 false
@_QFEx.0 = internal unnamed_addr global ptr null
@_QFEy.0 = internal unnamed_addr global ptr null
@_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5506/source.f\00"
@_QQcl.4E6F20576172 = linkonce constant [6 x i8] c"No War"
@_QQcl.576172 = linkonce constant [3 x i8] c"War"
@_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 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54, i32 5)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %3, i32 4)
  %9 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %4, i32 4)
  %10 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %5, i32 4)
  %11 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %6, i32 4)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %13 = load i32, ptr %3, 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 @_QFEx.0, align 8, !tbaa !7
  %18 = load i32, ptr %4, align 4, !tbaa !3
  %19 = call i32 @llvm.smax.i32(i32 %18, i32 0)
  %20 = zext i32 %19 to i64
  %21 = shl nuw nsw i64 %20, 2
  %22 = call ptr @malloc(i64 %21)
  store ptr %22, ptr @_QFEy.0, align 8, !tbaa !7
  %23 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54, i32 7)
  %.unpack = load ptr, ptr @_QFEx.0, align 8, !tbaa !7
  %24 = load i32, ptr %3, align 4, !tbaa !3
  %25 = call i32 @llvm.smax.i32(i32 %24, i32 0)
  %26 = zext i32 %25 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 %26, 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
  %27 = call i1 @_FortranAioInputDescriptor(ptr %23, ptr nonnull %2)
  %28 = call i32 @_FortranAioEndIoStatement(ptr %23)
  %29 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54, i32 8)
  %.unpack236 = load ptr, ptr @_QFEy.0, align 8, !tbaa !7
  %30 = load i32, ptr %4, align 4, !tbaa !3
  %31 = call i32 @llvm.smax.i32(i32 %30, i32 0)
  %32 = zext i32 %31 to i64
  store ptr %.unpack236, ptr %1, align 8, !tbaa !7
  %.fca.1.gep123 = 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.gep123, align 8, !tbaa !7
  %.fca.2.gep125 = 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.gep125, align 8, !tbaa !7
  %.fca.3.gep127 = 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.gep127, align 4, !tbaa !7
  %.fca.4.gep129 = 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.gep129, align 1, !tbaa !7
  %.fca.5.gep131 = 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.gep131, align 2, !tbaa !7
  %.fca.6.gep133 = 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.gep133, align 1, !tbaa !7
  %.fca.7.0.0.gep135 = 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.gep135, align 8, !tbaa !7
  %.fca.7.0.1.gep137 = 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 %32, ptr %.fca.7.0.1.gep137, align 8, !tbaa !7
  %.fca.7.0.2.gep139 = 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.gep139, align 8, !tbaa !7
  %33 = call i1 @_FortranAioInputDescriptor(ptr %29, ptr nonnull %1)
  %34 = call i32 @_FortranAioEndIoStatement(ptr %29)
  %35 = load i32, ptr %5, align 4, !tbaa !3
  %36 = load i32, ptr %6, align 4, !tbaa !3
  %37 = xor i32 %35, -1
  %38 = add i32 %36, %37
  %.0200279 = add i32 %35, 1
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph282, label %._crit_edge323

._crit_edge323:                                   ; preds = %0
  %.b.pre = load i1, ptr @_QFEe1, align 1
  %.b205.pre = load i1, ptr @_QFEe2, align 1
  br label %79

.lr.ph282:                                        ; preds = %0
  %40 = load i32, ptr %3, align 4, !tbaa !3
  %41 = icmp sgt i32 %40, 0
  %.unpack261 = load ptr, ptr @_QFEx.0, align 8
  %42 = load i32, ptr %4, align 4, !tbaa !3
  %43 = icmp sgt i32 %42, 0
  %.unpack249 = load ptr, ptr @_QFEy.0, align 8
  br i1 %41, label %.lr.ph282.split.us, label %.lr.ph282.split

.lr.ph282.split.us:                               ; preds = %.lr.ph282
  br i1 %43, label %.lr.ph.us.us, label %.lr.ph.us

.lr.ph.us.us:                                     ; preds = %.lr.ph282.split.us, %..loopexit_crit_edge.us.us.thread
  %.0200281.us.us = phi i32 [ %.0200.us.us, %..loopexit_crit_edge.us.us.thread ], [ %.0200279, %.lr.ph282.split.us ]
  %.0201280.us.us = phi i32 [ %44, %..loopexit_crit_edge.us.us.thread ], [ %38, %.lr.ph282.split.us ]
  br label %46

..loopexit_crit_edge.us.us.thread:                ; preds = %.lr.ph278.us.us, %..loopexit_crit_edge.us.us
  %44 = add i32 %.0201280.us.us, -1
  %.0200.us.us = add i32 %.0200281.us.us, 1
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph.us.us, label %._crit_edge283

46:                                               ; preds = %46, %.lr.ph.us.us
  %.0275.us.us = phi i32 [ 1, %.lr.ph.us.us ], [ %51, %46 ]
  %47 = sext i32 %.0275.us.us to i64
  %48 = add nsw i64 %47, -1
  %49 = getelementptr i32, ptr %.unpack261, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !3
  %.not.us.us.not = icmp sge i32 %50, %.0200281.us.us
  %51 = add nuw i32 %.0275.us.us, 1
  %exitcond321.not = icmp eq i32 %.0275.us.us, %40
  %or.cond = select i1 %.not.us.us.not, i1 true, i1 %exitcond321.not
  br i1 %or.cond, label %.lr.ph278.us.us, label %46

.lr.ph278.us.us:                                  ; preds = %46, %57
  %.1277.us.us = phi i32 [ %58, %57 ], [ 1, %46 ]
  %52 = sext i32 %.1277.us.us to i64
  %53 = add nsw i64 %52, -1
  %54 = getelementptr i32, ptr %.unpack249, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !3
  %56 = icmp slt i32 %55, %.0200281.us.us
  br i1 %56, label %..loopexit_crit_edge.us.us.thread, label %57

57:                                               ; preds = %.lr.ph278.us.us
  %58 = add nuw i32 %.1277.us.us, 1
  %exitcond322.not = icmp eq i32 %.1277.us.us, %42
  br i1 %exitcond322.not, label %..loopexit_crit_edge.us.us, label %.lr.ph278.us.us

..loopexit_crit_edge.us.us:                       ; preds = %57
  %.demorgan248.us.us = or i1 %.not.us.us.not, %56
  br i1 %.demorgan248.us.us, label %..loopexit_crit_edge.us.us.thread, label %._crit_edge

.lr.ph.us:                                        ; preds = %.lr.ph282.split.us, %.loopexit.us
  %.0200281.us = phi i32 [ %.0200.us, %.loopexit.us ], [ %.0200279, %.lr.ph282.split.us ]
  %.0201280.us = phi i32 [ %59, %.loopexit.us ], [ %38, %.lr.ph282.split.us ]
  br label %61

.loopexit.us:                                     ; preds = %61
  %59 = add i32 %.0201280.us, -1
  %.0200.us = add i32 %.0200281.us, 1
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph.us, label %._crit_edge283

61:                                               ; preds = %.lr.ph.us, %66
  %.0275.us = phi i32 [ 1, %.lr.ph.us ], [ %67, %66 ]
  %62 = sext i32 %.0275.us to i64
  %63 = add nsw i64 %62, -1
  %64 = getelementptr i32, ptr %.unpack261, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !3
  %.not.us.not.not = icmp slt i32 %65, %.0200281.us
  br i1 %.not.us.not.not, label %66, label %.loopexit.us

66:                                               ; preds = %61
  %67 = add nuw i32 %.0275.us, 1
  %exitcond320.not = icmp eq i32 %.0275.us, %40
  br i1 %exitcond320.not, label %._crit_edge, label %61

.lr.ph282.split:                                  ; preds = %.lr.ph282
  br i1 %43, label %.loopexit273.us290, label %._crit_edge

.loopexit273.us290:                               ; preds = %.lr.ph282.split, %68
  %.0200281.us291 = phi i32 [ %.0200.us293, %68 ], [ %.0200279, %.lr.ph282.split ]
  %.0201280.us292 = phi i32 [ %69, %68 ], [ %38, %.lr.ph282.split ]
  br label %71

68:                                               ; preds = %71
  %69 = add i32 %.0201280.us292, -1
  %.0200.us293 = add i32 %.0200281.us291, 1
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.loopexit273.us290, label %._crit_edge283

71:                                               ; preds = %.loopexit273.us290, %77
  %.1277.us294 = phi i32 [ 1, %.loopexit273.us290 ], [ %78, %77 ]
  %72 = sext i32 %.1277.us294 to i64
  %73 = add nsw i64 %72, -1
  %74 = getelementptr i32, ptr %.unpack249, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !3
  %76 = icmp slt i32 %75, %.0200281.us291
  br i1 %76, label %68, label %77

77:                                               ; preds = %71
  %78 = add nuw i32 %.1277.us294, 1
  %exitcond.not = icmp eq i32 %.1277.us294, %42
  br i1 %exitcond.not, label %._crit_edge, label %71

._crit_edge:                                      ; preds = %77, %66, %..loopexit_crit_edge.us.us, %.lr.ph282.split
  store i1 false, ptr @_QFEe1, align 1
  store i1 false, ptr @_QFEe2, align 1
  br label %79

._crit_edge283:                                   ; preds = %68, %.loopexit.us, %..loopexit_crit_edge.us.us.thread
  %.us-phi = phi i1 [ %56, %..loopexit_crit_edge.us.us.thread ], [ false, %.loopexit.us ], [ true, %68 ]
  %.us-phi287 = phi i1 [ %.not.us.us.not, %..loopexit_crit_edge.us.us.thread ], [ true, %.loopexit.us ], [ false, %68 ]
  store i1 %.us-phi287, ptr @_QFEe1, align 1
  store i1 %.us-phi, ptr @_QFEe2, align 1
  br label %79

79:                                               ; preds = %._crit_edge323, %._crit_edge283, %._crit_edge
  %.b205 = phi i1 [ %.b205.pre, %._crit_edge323 ], [ %.us-phi, %._crit_edge283 ], [ false, %._crit_edge ]
  %.b = phi i1 [ %.b.pre, %._crit_edge323 ], [ %.us-phi287, %._crit_edge283 ], [ false, %._crit_edge ]
  %.demorgan = or i1 %.b, %.b205
  br i1 %.demorgan, label %83, label %80

80:                                               ; preds = %79
  %81 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54, i32 27)
  %82 = call i1 @_FortranAioOutputAscii(ptr %81, ptr nonnull @_QQcl.4E6F20576172, i64 6)
  br label %86

83:                                               ; preds = %79
  %84 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.2bdbeee5cd3403faf98ebc4dc340ca54, i32 29)
  %85 = call i1 @_FortranAioOutputAscii(ptr %84, ptr nonnull @_QQcl.576172, i64 3)
  br label %86

86:                                               ; preds = %80, %83
  %.sink = phi ptr [ %81, %80 ], [ %84, %83 ]
  %87 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) 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}
