I think there is something wrong with the branch_stack:
e.g.
..... 29: 00000000004005a0 -> 00000000004005b0 0 cycles P 0
..... 30: 0000000000400888 -> 000000000040088c 0 cycles P 0
..... 31: 000000000040088c -> 0000000000400898 0 cycles P 0
from the objdump:
400884: 97ffff3f bl 400580 <__printf_chk@plt> 400888: 97ffff46 bl 4005a0 <rand@plt> 40088c: b8004660 str w0, [x19],#4 400890: eb14027f cmp x19, x20 400894: 54ffffa1 b.ne 400888 <sort_array+0x50> 400898: d285e280 mov x0, #0x2f14
looks like 400888 is not jumping to 40088c, but 4005a0 instead. and 40088c is not even a jump instruction.
Dehao