program abc121d
  integer(8) a, b
  read *, a, b
  if (a > 0) a = a - 1
  print *, xor(f(a), f(b))
contains
  recursive function f(n) result(res)
    integer(8), intent(in) :: n
    integer(8) res
    res = merge(n, xor(n, f(n - 1)), mod(n, 4) == 0)
  end function f
end program abc121d

; 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.fe3f0bf743759efbf2ae9f5554fbab53 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4771/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.fe3f0bf743759efbf2ae9f5554fbab53, i32 3)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 8)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 8)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i64, ptr %1, align 8, !tbaa !3
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %9, label %11

9:                                                ; preds = %0
  %10 = add nsw i64 %7, -1
  store i64 %10, ptr %1, align 8, !tbaa !3
  br label %11

11:                                               ; preds = %9, %0
  %12 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.fe3f0bf743759efbf2ae9f5554fbab53, i32 5)
  %13 = call i64 @_QFPf(ptr nonnull %1)
  %14 = call i64 @_QFPf(ptr nonnull %2)
  %15 = xor i64 %14, %13
  %16 = call i1 @_FortranAioOutputInteger64(ptr %12, i64 %15)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %12)
  ret void
}

; Function Attrs: nofree nosync nounwind memory(argmem: read)
define i64 @_QFPf(ptr nocapture readonly %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = load i64, ptr %0, align 8, !tbaa !3
  %4 = add i64 %3, -1
  store i64 %4, ptr %2, align 8, !tbaa !3
  %5 = call i64 @_QFPf(ptr nonnull %2)
  %6 = and i64 %3, 3
  %7 = icmp eq i64 %6, 0
  %8 = select i1 %7, i64 0, i64 %5
  %9 = xor i64 %8, %3
  ret i64 %9
}

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 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

attributes #0 = { nofree nosync nounwind memory(argmem: read) }

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