# expected: 000001BC, 000002BC, 000003BC, 000004BC, 000006BC, 000000BC, 00003BC
    .text
_start:
    li x5, 0x0
    # case1: greater -> should jump -> write 0x1BC
    add x1, x0, 0x010
    add x2, x0, 0x00F
    bge x1, x2, case1_target
    add x31, x0, 0x3BC
case1_target:
    add x31, x0, 0x1BC

    # case2: equal -> should jump -> write 0x2BC
    add x1, x0, 0x1BC
    add x2, x0, 0x1BC
    bge x1, x2, case2_target
    add x31, x0, 0x3BC
case2_target:
    add x31, x0, 0x2BC

back_label:
    bne x5, x0, back_label_flagged
    # no-flag path (fall-through)
    add x1, x0, 0x000
    add x2, x0, 0x001
    li x31, 0x3BC
    jal x0, back_label_cont
back_label_flagged:
    li x31, 0x0BC
    li x5, 0x0
    jal x0, after_backward
back_label_cont:

    # case3: less -> should not jump -> write 0x4BC
    add x1, x0, 0x001
    add x2, x0, 0x002
    bge x1, x2, case3_target
    add x31, x0, 0x4BC
case3_target:
    # case4: negative values -> signed compare, should jump
    add x1, x0, -1
    add x2, x0, -2
    bge x1, x2, case4_target
    add x31, x0, 0x7BC
case4_target:
    add x31, x0, 0x6BC

    add x5, x0, 0x1
    add x1, x0, 0x002
    add x2, x0, 0x001
    bge x1, x2, back_label

    li x1, 0xABC
    bge x1, x1, same_reg_target
    li x31, 0x2BC
same_reg_target:
    li x31, 0x1BC

after_backward:
    # final marker
    li x31, 0x3BC
