#import <stdio.h>

typedef unsigned long long UINT;

int main(){
    UINT a,b;
    scanf("%llu %llu", &a,&b);
    UINT s = a%2;
    UINT e = b%2;
    UINT r;
    if(s==0 && e==1){
        r = (b+1-a)/2 % 2;
    }
    if(s==0 && e==0){
        r = ((b-a)/2 % 2) ^ b;
    }
    if(s==1 && e==1){
        r = ((b-a)/2 % 2) ^ a;
    }
    if(s==1 && e==0){
        r = ((b-1-a)/2 % 2) ^ a ^ b;
    }
    printf("%llu\n", r);
    return 0;
}


; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_351/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_351/source.m"
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"

@.str = private unnamed_addr constant [10 x i8] c"%llu %llu\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %a = alloca i64, align 8
  %b = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
  %0 = load i64, ptr %a, align 8, !tbaa !5
  %rem = and i64 %0, 1
  %1 = load i64, ptr %b, align 8, !tbaa !5
  %rem1 = and i64 %1, 1
  %cmp = icmp eq i64 %rem, 0
  %cmp6 = icmp eq i64 %rem1, 0
  %or.cond33 = select i1 %cmp, i1 %cmp6, i1 false
  br i1 %or.cond33, label %if.end20.thread53, label %if.end11

if.end20.thread53:                                ; preds = %entry
  %sub8 = sub i64 %1, %0
  %div943 = lshr i64 %sub8, 1
  %rem10 = and i64 %div943, 1
  %xor = xor i64 %rem10, %1
  br label %if.end31

if.end11:                                         ; preds = %entry
  %cmp2 = icmp ne i64 %rem1, 0
  %reass.sub = sub i64 %1, %0
  %cmp12 = icmp ne i64 %rem, 0
  %or.cond34 = select i1 %cmp12, i1 %cmp2, i1 false
  br i1 %or.cond34, label %if.end20.thread, label %if.end20

if.end20.thread:                                  ; preds = %if.end11
  %div1744 = lshr i64 %reass.sub, 1
  %rem18 = and i64 %div1744, 1
  %xor19 = xor i64 %rem18, %0
  br label %if.end31

if.end20:                                         ; preds = %if.end11
  %or.cond = select i1 %cmp, i1 %cmp2, i1 false
  %sub = add i64 %reass.sub, 1
  %div42 = lshr i64 %sub, 1
  %rem3 = and i64 %div42, 1
  %r.0 = select i1 %or.cond, i64 %rem3, i64 undef
  %or.cond35 = select i1 %cmp12, i1 %cmp6, i1 false
  br i1 %or.cond35, label %if.then24, label %if.end31

if.then24:                                        ; preds = %if.end20
  %2 = xor i64 %0, -1
  %sub26 = add i64 %1, %2
  %div2745 = lshr i64 %sub26, 1
  %rem28 = and i64 %div2745, 1
  %3 = xor i64 %0, %rem28
  %xor30 = xor i64 %3, %1
  br label %if.end31

if.end31:                                         ; preds = %if.end20.thread53, %if.end20.thread, %if.then24, %if.end20
  %r.3 = phi i64 [ %xor30, %if.then24 ], [ %r.0, %if.end20 ], [ %xor19, %if.end20.thread ], [ %xor, %if.end20.thread53 ]
  %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %r.3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
