// branch.s -
// compare 2 ints
// Expects:
//      x0: long int a
//      x1: long int b
// Returns:
//      x0: long int answer
.equ FrameSize, 16
    .text
    .global branch
branch:
    stp  x29, x30, [sp, -FrameSize] !   // set up frame
    mov  x29, sp                        // set fp

    cmp  x0, x1
    b.le not_g
    sub  x0, x0, x1
    b    done
not_g:
    cmp  x0, x1
    b.ge not_l
    sub  x0, x1, x0
    b    done
not_l:
    nop         // don't need to do anything
done:
    mov  sp, x29                        // restore sp
    ldp  x29, x30, [sp], FrameSize      // tear down frame
    ret
#--------