program main
  implicit none
  
  integer :: a,b
  read(*,*)a,b
  
  if ((a == 1) .and. (b == 2)) then
    write(*,*)3
  else if ((a == 1) .and. (b == 3)) then
    write(*,*)2
  else if ((a == 2) .and. (b == 1)) then
    write(*,*)3
  else if ((a == 2) .and. (b == 3)) then
    write(*,*)1
  else if ((a == 3) .and. (b == 1)) then
    write(*,*)2
  else if ((a == 3) .and. (b == 2)) then
    write(*,*)1
  end if
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"

@_QQcl.851161ac915a51c4f3cba40baada5096 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2788/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 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 5)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %1, align 4, !tbaa !3
  %8 = icmp eq i32 %7, 1
  %9 = load i32, ptr %2, align 4, !tbaa !3
  %10 = icmp eq i32 %9, 2
  %11 = and i1 %8, %10
  br i1 %11, label %12, label %15

12:                                               ; preds = %0
  %13 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 8)
  %14 = call i1 @_FortranAioOutputInteger32(ptr %13, i32 3)
  br label %.sink.split

15:                                               ; preds = %0
  %16 = icmp eq i32 %9, 3
  %17 = and i1 %8, %16
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 10)
  %20 = call i1 @_FortranAioOutputInteger32(ptr %19, i32 2)
  br label %.sink.split

21:                                               ; preds = %15
  %22 = icmp eq i32 %7, 2
  %23 = icmp eq i32 %9, 1
  %24 = and i1 %22, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 12)
  %27 = call i1 @_FortranAioOutputInteger32(ptr %26, i32 3)
  br label %.sink.split

28:                                               ; preds = %21
  %29 = and i1 %22, %16
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  %31 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 14)
  %32 = call i1 @_FortranAioOutputInteger32(ptr %31, i32 1)
  br label %.sink.split

33:                                               ; preds = %28
  %34 = icmp eq i32 %7, 3
  %35 = and i1 %34, %23
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 16)
  %38 = call i1 @_FortranAioOutputInteger32(ptr %37, i32 2)
  br label %.sink.split

39:                                               ; preds = %33
  %40 = and i1 %34, %10
  br i1 %40, label %41, label %45

41:                                               ; preds = %39
  %42 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.851161ac915a51c4f3cba40baada5096, i32 18)
  %43 = call i1 @_FortranAioOutputInteger32(ptr %42, i32 1)
  br label %.sink.split

.sink.split:                                      ; preds = %41, %36, %30, %25, %18, %12
  %.sink = phi ptr [ %13, %12 ], [ %19, %18 ], [ %26, %25 ], [ %31, %30 ], [ %37, %36 ], [ %42, %41 ]
  %44 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  br label %45

45:                                               ; preds = %.sink.split, %39
  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"}
