program main
    implicit none
    integer x1, x2, x3, x4, x5

    read(*,*) x1, x2, x3, x4, x5
    if (x1 == 0) then
        write(*,*) 1
    else if (x2 == 0) then
        write(*,*) 2
    else if (x3 == 0) then
        write(*,*) 3
    else if (x4 == 0) then
        write(*,*) 4
    else if (x5 == 0) then
        write(*,*) 5
    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"

@_QQcl.95fd06bca9063e15d27ecf18cf4efbf3 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1172/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 5)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %1, i32 4)
  %8 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %2, i32 4)
  %9 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %3, i32 4)
  %10 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %4, i32 4)
  %11 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %5, i32 4)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %13 = load i32, ptr %1, align 4, !tbaa !3
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %18

15:                                               ; preds = %0
  %16 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 7)
  %17 = call i1 @_FortranAioOutputInteger32(ptr %16, i32 1)
  br label %.sink.split

18:                                               ; preds = %0
  %19 = load i32, ptr %2, align 4, !tbaa !3
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 9)
  %23 = call i1 @_FortranAioOutputInteger32(ptr %22, i32 2)
  br label %.sink.split

24:                                               ; preds = %18
  %25 = load i32, ptr %3, align 4, !tbaa !3
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 11)
  %29 = call i1 @_FortranAioOutputInteger32(ptr %28, i32 3)
  br label %.sink.split

30:                                               ; preds = %24
  %31 = load i32, ptr %4, align 4, !tbaa !3
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 13)
  %35 = call i1 @_FortranAioOutputInteger32(ptr %34, i32 4)
  br label %.sink.split

36:                                               ; preds = %30
  %37 = load i32, ptr %5, align 4, !tbaa !3
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %43

39:                                               ; preds = %36
  %40 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.95fd06bca9063e15d27ecf18cf4efbf3, i32 15)
  %41 = call i1 @_FortranAioOutputInteger32(ptr %40, i32 5)
  br label %.sink.split

.sink.split:                                      ; preds = %39, %33, %27, %21, %15
  %.sink = phi ptr [ %16, %15 ], [ %22, %21 ], [ %28, %27 ], [ %34, %33 ], [ %40, %39 ]
  %42 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  br label %43

43:                                               ; preds = %.sink.split, %36
  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

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