# expected: 000002BC, 000004BC, 000007BC, 000005BC
    .text
_start:
    # forward jal -> should jump to target and set x1 to return addr
    jal x1, jal_target
    add x31, x0, 0x1BC
jal_target:
    add x31, x0, 0x2BC

    add x5, x0, 0x1
    jal x2, jal_back_target
    add x31, x0, 0x3BC
jal_back_target:
    add x31, x0, 0x4BC
    jal x0, after_jal_back
jal_back_flag:
    add x31, x0, 0x5BC
after_jal_back:

    # same-target jal to next insn (offset small) -> should set x3 and continue
    jal x3, same_jal_target
    add x31, x0, 0x6BC
same_jal_target:
    add x31, x0, 0x7BC

    # final marker
    add x31, x0, 0x5BC

