program sample
	implicit none
    integer(8) :: x(5)
    
    read(*,*) x
    
    if (x(1) ==0) then
    	write(*,*) 1
    else if (x(2) ==0) then
    	write(*,*) 2
    else if (x(3) ==0) then
    	write(*,*) 3
    else if (x(4) ==0) then
    	write(*,*) 4
    else if (x(5) ==0) then
    	write(*,*) 5        
    end if
    stop
end program sample

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

@_QFEx = internal global [5 x i64] undef
@_QQcl.3781144827a2c261358e07308fa514fa = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1171/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.3781144827a2c261358e07308fa514fa, i32 5)
  store ptr @_QFEx, ptr %1, align 8, !tbaa !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 !3
  %.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 5, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.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 !3
  %3 = call i1 @_FortranAioInputDescriptor(ptr %2, ptr nonnull %1)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i64, ptr @_QFEx, align 16, !tbaa !7
  %6 = icmp eq i64 %5, 0
  br i1 %6, label %.sink.split, label %7

7:                                                ; preds = %0
  %8 = load i64, ptr getelementptr inbounds ([5 x i64], ptr @_QFEx, i64 0, i64 1), align 8, !tbaa !7
  %9 = icmp eq i64 %8, 0
  br i1 %9, label %.sink.split, label %10

10:                                               ; preds = %7
  %11 = load i64, ptr getelementptr inbounds ([5 x i64], ptr @_QFEx, i64 0, i64 2), align 16, !tbaa !7
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %.sink.split, label %13

13:                                               ; preds = %10
  %14 = load i64, ptr getelementptr inbounds ([5 x i64], ptr @_QFEx, i64 0, i64 3), align 8, !tbaa !7
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %.sink.split, label %16

16:                                               ; preds = %13
  %17 = load i64, ptr getelementptr inbounds ([5 x i64], ptr @_QFEx, i64 0, i64 4), align 16, !tbaa !7
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %.sink.split, label %22

.sink.split:                                      ; preds = %16, %13, %10, %7, %0
  %.sink = phi i32 [ 8, %0 ], [ 10, %7 ], [ 12, %10 ], [ 14, %13 ], [ 16, %16 ]
  %.sink2 = phi i32 [ 1, %0 ], [ 2, %7 ], [ 3, %10 ], [ 4, %13 ], [ 5, %16 ]
  %19 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.3781144827a2c261358e07308fa514fa, i32 %.sink)
  %20 = call i1 @_FortranAioOutputInteger32(ptr %19, i32 %.sink2)
  %21 = call i32 @_FortranAioEndIoStatement(ptr %19)
  br label %22

22:                                               ; preds = %.sink.split, %16
  %23 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) 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

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
